Field isn't updated by button in sharepoint list (SP 2019)

Good day all,
i'm on SP 2019 and using Plumsail forms (trial version since yesterday, but pretty sure we will buy it).

I want a simple button that changes a field value in my sharepoint list and save it after clicking.
I added a Button control and put in the following js in the "OnClick" property.

fd.spBeforeSave(function() {
fd.field('Title').value = 'Approved';
return fd._vue.$nextTick();
});

return fd.save();

When i click the button, i get the message that the form was submitted successfully, but the field isn't updated in the Sharepoint List. I also tried to edit another field within the Plumsail form and that works just fine.

When clicking the button I get the following error:

Pic of Error:

Can someone lead me to a fix for this problem?

Hello @JonHebbe,

Welcome to Plumsail Community!

In button's OnClick property you need to use the code below to change the field value and submit the form:

fd.field('Title').value = 'Approved';
return fd.save();

Good morning @mnikitina,

unfortunately this does not work :frowning:

@JonHebbe,

Are you getting any errors in the browser console(F12) when the button is clicked? Please share the screenshot.

Please share the screenshot of the code that you used in the button's OnClick property.

I just figured it out by myself! I had exported the "new form" and imported it into the "edit form", but didn't delete the global javascript I've used for the new form. Therefore there were errors i guess and it didn't update the field.

I now know how to do this - thank you very much!

1 Like