How to POST list of resources (more then 1)?
I have POST endpoint for resource "Thought"
Query Parameters:
Body
{
"description": "string",
"percent_believe": integer
}
It is easy.
But my interface has option of adding some resources "Thoughts" when user clicks button "Save". If user doesn't click button "Save" then thoughts haven't to be saved.
{
[
{"description": "thought 1",
"percent_believe": 90
},
{"description": "thought 2",
"percent_believe": 100
}
]
}
How to POST some resources (more then 1).
Best Answers
-
try adding input on your API like so:
this will expect a [] list(array) of objects {} - like you described
-
If you want to add every element of the list as a seprateed record then you should set you input as JSON and use "add multiple records in bulk"
-
Pretty much you need to send an array of json objects that have the same paramters name that the table you want to add records to. You don't need to send all the parameters from the table though, if I remember correctly.
-
Here:
Answers
-
Pawel, that is what I need! Perfect! Thanks!
But I haven't tried JSON in Inputs. I'll learn about JSON in Inputs and bulk operations. How
-
Pawel, thanks for array of JSON objects
And where I can find "add multiple records in bulk"?
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