13
Views
3
Comments
How to update only changed records to a local variable list
Question

How to update only changed records to a local variable list and then save only that record in database.



I have a list fetched from database using a Data Action from API, it has a parent list and child list with the parent.

I am using this API output to display data on the screen. The widgets are editable and when I edit any value and save it.

All the records in the list are getting updated again instead of just updating the changed record.



I am using ListAppend, but it is not helpful :


Kindly help.

Champion
Rank: #99

Hi,


Are you using an auxiliar list to place only the records edited an then update only the records int that auxiliar list?

I'm sorry, but by the print I can't understand very well your use case. Can you share a little bit more code or share an OML for us to have full context please?

Thanks!


Hope this can help.


Best regards,

Ricardo M Pereira

Rank: #173

Hi Sushma C,

Can you share your .OML for we understand better what happens?

But if you want to edit only the records that have been changed, a possible solution is to put an IF before ListAppend, and check if the record has changed, if yes, include it in the list of changed records with ListAppend.

Regards.


Hi Sushma,

Try adding a Boolean variable to the list as isChanged and filter the records on the basis of the isChanged value.

Then you can update only the changed record. Also before trying the solution you can keep a local copy of original list in case if you want to compare anything.

Thanks,

Unnati K