Updating array variable with value entered by user

I have a datagrid that is bound to an array variable. I want the user to be able to edit a field and when they do, I want the array variable to be updated.

I have an ‘on change’ workflow attached to the input field, configured as shown below. I have it configured to “Update one item” in the array using the index of the current item in the datagrid. I think that piece is right? But I can’t figure out what to put in the Value field. I tried asking the Co-Pilot to generate some custom js to update the variable with the event.value, but it didn’t work. Am I doing this right and if so, what should I put in the Value field please?

Thanks!

I got it to work with some custom JS generated by Co-Pilot running directly on the ‘on change’ - amazing. But I’m sure there is a no-code way to do this and would appreciate if someone could enlighten me.

Thanks. :slightly_smiling_face:

1 Like

I’m glad copilot was able to help you. Yes you can do it in a nocode way, it will be easier to maintain, what you have to bind in the value field is what you will find in the “lightning tab” of the explorer (the 4th one in your capture), the event->value, this is what copilot achieved in the code he generated.

You will have to toggle “partial update” if you want to update only the amount property (and if your event->value contain only the new amount and not the complete new item)

1 Like