Button to Mass Update a Field on all List Items in Local Storage

Hello, I am trying to perform an update to a different local storage list based on a value on a page. For example, if I have 23 entered into the input field on my page, and I click a save button, the logic would go grab the separate list, and update field ‘total count for list item’ by adding 23 to that items value and save the list.

I have tried a handful of different things, but am not able to resolve this issue.

My form is for saving notes. One of the fields is a number - we can call it Hours Spent. When I save the form it saves this hours spent to the notes just fine. When saving, I also want it to update all of the list items in another list - maintenance items - stored in a separate object local storage. The update would add the ‘Hours Spent’ with a ‘total hours spent’.

In code the logic would be something like the pseudo code below:
get maintenanceItems from local storage
for (maintenanceItem in maintenanceItems) {
maintenanceItem.totalHoursSpent = maintenanceItem.totalHoursSpent + note.hoursSpent;
}
update maintenanceItems;

I’m struggling with what seems to be a limitation of the ‘update’ logic component. I can get a collection, update the values in a repeat component (eventually could be hidden from the ui) and get all the values to update in the variables. However, when I try to make the update back to the data store, I can’t figure out how to make it save that piece.

I can see the updates through the UI, but if I navigate to the list of maintenance items after saving, the ‘total hours spent’ never updates.

Hello @Mevi any thoughts on this? I see you are generally very helpful and provide good insight in other tough questions. :slight_smile: