I need some help, please!
How can I synchronize only specific fields in my database? When I select only the fields to bind in Weweb and make a request in Xano, it seems to “clear” the other fields already stored in Xano.
For your information, I have a customer profile, and I created a modal on this profile so that customers can add their documents to their profile. I would like only the link to be added in the correct field in Xano. If you need more information, please don’t hesitate to ask. It may not be very clear.
You could have an object variable with “selected user” that you update at the start of your workflow. You then bind all the fields of your POST request to this variable and the two new fields to the inputs of your modal.
If you want to enable the partial update of a Xano endpoint, you need to specify it in Xano. By default, if you send values for column 1 and column 3 only, Xano will clear the data in column 2.
Another solution is to ask WeWeb to send back the values of all the columns to Xano.
At first glance, @AdrienB’s solution could work. I see from your video that you have an action with the candidate modal information further up in your workflow so you might not even need to create a new variable.
If you don’t have all the information you need in the Candidate Modal Information variable and don’t want to pollute your project with another global variable because it’s a temporary variable you don’t need outside this workflow, you can use the “Return a value” action in your workflow:
@dorian’s suggestion below this is a good one. For a different perspective, I would probably handle it by making another endpoint that just handles this job. This increases your number of endpoints, but the query is simpler because It only receives these specific fields rather than the general case of receiving all fields.YOu send the data, and then after it comes back, refresh your collection.
Looking at this more broadly, the partial update thing is a pain in REST metaphors. Loosening up from a rigid REST implentation and permitting these “ad hoc” queries - especially for writes - can save you a lot of headache. And loosening up is what these no-code/low-code tools let us do!
I hate first_notempty for most use cases. Def prefer the first_notNull
First not empty doesn’t let you clear a field….
Say I have field ‘name’ and it holds the value “JARED”. I want to clear the name. I can’t send “” (an empty string) as the value.
The GET / UPDATE method won’t clear the string this way if using first not empty. The first not empty would be the old value “Jared”. Instead first not Null would only replace the values of the fields I send. Everything else retains its previous value. I can even send an empty string.
Again, this won’t work in all use cases but I def use this more than the other.
I followed exactly the same process and i have an error. The GET function is working well, i have all the informations needed, but when activating the EDIT, i have an error, and i can’t figure out what’s going wrong here : Bird Eats Bug
Since this thread opened, there has passed a bit of time. Is there in the meantime a better solution?
Unfortunately, the link in the answer of @Joyce is not available anymore. An answer would be greatly appreciated, because it is quite dangerous to develop, when after changing the database structure a little bit, you have to update all the workflows of your app, in order to prevent the deleting of important data.