PATCH Conditional Filters
I want to utilize PATCH to update a user's information, but found that I cannot update information on my frontend without filling out all the criteria listed here:
I want it such that a single field can be updated without the need to updated the other fields. For example, only updated a firstname and not lastname, computingid, and years_id
How do I set up a conditional filter to accomplish this goal?
Answers
-
My intuition was to utilize this:
But not sure where to go from here.
-
Hey @NWold!
I created this video highlighting how you can use conditional filters to update only fields where information is being provided by the front end. Let me know if this is helpful or if you have further questions. 😊
-
Hi so I utilized what you said on the video as such:
Yet I am still receiving this error:
What are any common mistakes with this method that would contribute to this error?
-
This method is doing exactly what I want to accomplish. I am just not understanding why the error is prevalent.
-
Hey @NWold! Can you edit your
firstname
input and make sure that "Required" is set to no. Let me know if this fixes the issue. -
That managed to fix the error, but a new problem arose. A couple variables, most notably firstname and lastname will either become blank if left as "" or it will become blank when I change the value once then leave it as "". For example:
then the next time around:
The other values such as ComputingID and years_id are unchanged, which is good, but the firstname and lastname are having these problems.
-
Hey @NWold, this is interesting. Did anything change in your
Edit Record
function? I'm trying to replicate this on my end, but I am not seeing the same issue.Also, if you could record a quick Loom showing the data you are providing on your inputs and the results you get, that would be greatly appreciated! 🙏 From the screenshots, I'm having difficulty understanding if the field is becoming blank even if you provide data in the input.
-
I found out the issue was in some marginal issues with inputing my variables. Everything seems to work now! Thank you for the help!
-
Woohoo! 🥳 Thanks for the update, @NWold. Glad to hear everything is working now!
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