How to sync one field to Xano?

Hello team,

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.

Thank you!

1 Like

When you bind your fields, click on “Body fields” and you can select the fields you want to bind.

1 Like

That’s what i tried to do, but, it clear all my “client” fields on my database.
Quick video to show you guys : Bird Eats Bug

1 Like

Maybe you need a PUT endpoint on xano side ?

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.

1 Like

Will try this method. Let you know on Monday!
Thanks for your help!

Hi @Kevin_Letllr :wave:

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.

It’s quite complex to setup in Xano but doable. @raydeck may be able to help you with this :slightly_smiling_face:

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:

Make sure to test the action so you can access it’s result in steps below:

Hope this helps!

The simplest way is to use the first_notempty filter in Xano. Works perfectly for me. Details in this video from @Michael_Xano:

1 Like

@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!

2 Likes

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.

1 Like

Good point, thanks @jaredgibb. In my use cases I don’t want the user clearing the fields, so first_notempty works for me.

1 Like

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

any help @Michael_Xano ? :slight_smile: