Get specifics fields listed in an array from an external API response
Hello,
I tried to map some fields with one of my databases who are listed in an array in an API response.
The API response return me a list of entity with basics fields but 23 more fields are listeds in an array. I can identity the fields i need with a name or an ID and then return the vaue of the field. (As you can see in the screen of the API response).
I do not know how i can i build a get in my "Add or Edit Record" to map a specific field who is locatated in that array with a field of ma database.
I tried to build something like in the screenshot i shared you but i doeasn't work.
In my exemple i tried to map the field named “Price”.
Anyone could help me ?
Thanks !
Answers
-
Hey @Romain B
You'll notice that the value line says “entity” but right above you have this as a text string. It's very important that you are searching through the variable entity. This is a common roadblock we see (start at 5:00):
To Add (or Edit) an array of records to a database you'll need to use a For Each Loop to iterate through each record. Here's an example of how to do so:
If you need to filter your results first, based on a specific field value you can use the Array Function: Find All Elements. This will return a new array that matches the WHERE clause you define.
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