How to update the value of object
Options
tomas randomas
Member ✭
Hello, ran into a strange issue while using an external API,
{
"id": 1,
"lat": 55.082226,
"lng": 22.76919399999946,
"rank": 2
},
{
"id": 2,
"lat": 55.082226,
"lng": 22.76919399999946,
"rank": false
}
This is the response that I get, and in my database, I have 'rank' field as an integer.
Is there a way to replace those objects that have
"rank": false
to "rank" : 1
Thank you 🙌
Tagged:
Answers
-
Hi,
as a quick solution you can create a loop through that list and inside the loop create a conditional that will check if the "rank" in current item is false. If true then you can use "update variable" function pick item and update rank path, setting value to 1.
Hope that helps, if you have any issues please let me know.
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