Please how do I get the setFieldvalue to actually save with .save()

This is my code below, the filter filters the field key " whoReferredYou"with a specific referral code value saved as X after dataset10 has been filtered based on the current loggedin owner. The problem is when the button has been clicked, the dataset is filtered accordingly and the “APPLIED” Value only replaces the first value of all the filtered results, but the new value “APPLIED” is not saved parmanently in the database, it only returns back to is original state after the page is refreshed. Please I need help on this, Thanks.

export function button55_click(event,$w) {
$w( “#dataset10” ).onReady(() => {
let X = $w( “#dataset10” ).getCurrentItem().referralCode
$w( “#dataset21” ).onReady(() => {
$w( “#dataset21” ).setFilter(wixData.filter()
.contains( “whoReferredYou” , X))

    .then(() => { 

let tem = “APPLIED”

    $w( "#dataset21" ).setFieldValue( "whoReferredYou" , tem) 

    $w( "#dataset21" ).save() 

}) 

}) 

})

Hey Chidi,

I’m not 100% on what it is you’re trying to do here but if you want to save the values that a user has entered on a page for them you can use the wix-storage API.

Once you set the items to the local storage the values will remain even if the page is refreshed or closed.

If this doesn’t help please elaborate more on what you are trying to do.

Hope this helps!

Dara | Corvid Team

Hi Dara thanks for your response, I am trying to replace a field’s values on my site’s database with the setfieldvalue method and save it parmanently with the .save() method on same database after a button is clicked by a user. Thanks