need a specific format response
I have a specific response format which like this
test:5.0:customer:{
"value1":1236,
"value2":"hello"
}
the key name is like this test:5.0:customer which static
but when i try to create this response using set filter expected result not come the result which come like this
test:5:
{
0:customer:
{
"value1":1236,
"value2":"hello"
}
}
which is wrong i don't want this format response i think its happened because of dot notation is sperate a key name to a object
Comments
-
I had one of these recently. Had to add a little javascript to make it work, because Xano confuses the period in the key name for dot notation. We built this little function.
// Create an object with the key you want to updateconst myObject = $var.input_data
// Specify the new key nameconst newKeyName = "company_data";
// Get the value of the old keyconst valueToMove = myObject["urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"];
// Delete the old keydelete myObject["urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"];
// Create a new key with the desired name and copy the valuemyObject[newKeyName] = valueToMove;
return myObject; -
Thanks josh
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback