how to edit an existing record targeting it by two or more parameters (fields) evaluating to true?
I want to update a field for a record based on if two column values are true for that record.
E.g - Update/Edit "Complete_Status" to a "1"
IF "Customer_ID" == "12345" AND && "Subscriber_Status" == "Subscribed"
How would I got about doing this? I see that the Edit a record endpoint has the limit stating "If you choose a field_value that maps to multiple records, then the first one found will be used."
I have already figured out how to do this on the GET side of things by using Query All but how do I do it on the POST/edit side?
Thank you.
Best Answer
-
Sounds like you are tripped up with using the loop?
Here's an example of adding records (start at 5:20)
Also take a look at our common roadblocks video at (0:28) and (12:08) regarding loops and lists
Answers
-
Hey @bcasmvrg — same idea here. Use the Query All Records to retrieve the records based on multiple parameters. If you are editing a list you need to use a For Each Loop to Edit each item of the list.
- Query All Records
- For Each Loop
- Edit Record
-
Thanks for the response @Michael Udinski. I am having a bit of trouble building this out.
I would be running the For each loop on variable that gets produced from the Query All Records part of the function stack correct? After I run that for each loop - how do I go about updating the records I want from the input?Thank you.
-
This is resolved. Thank for the the resources, the 2nd video was especialyl helpful (common roadblocks). It was how I was referencing the variables in the loop that was tripping me up. 👍️
-
great :)
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