Hi,
I have a data type “costs” and a data type “cost entry”. A cost can have several cost entries. The initial creation works fine, I just can’t find a good solution for editing.
Initial situation:
The user can edit the cost via a popup. Within the popup you can see the item “Costs” - these are the cost entries in a repeating group.
What I want to achieve:
I want the cost entries in the edit popup to be saved only when the user clicks on the “Save cost” button at the bottom.
The problem:
I cannot access inputs from the repeating group in the workflow and therefore cannot perform a “Make changes to a thing” action.
What I have tried:
-
Placed a save icon next to the inputs in the repeating group. Then I can use a “Make changes to a thing” workflow. What I don’t like about this is that the user has to click on the icon for each individual cost entry and also on the button at the bottom if the other metadata is to be saved to the cost.
I don’t like this solution very much for UX reasons - but it works. -
When opening the edit popup I load all existing cost-entries into a custom state (list of cost entries). This works great. if I change the inputs, I can also update the corresponding entry in the custom state via an “Input has changed” workflow.
When I click on the “Save cost” button I add the list from the custom state as a list to the costs - everything works perfectly.
BUT: When the user clicks on “Cancel” the cost-entries are already saved and cannot be undone.
Therefore my questions:
1.) Does anyone have an idea how I can solve the way with the custom states correctly?
2) Is there an alternative solution that I haven’t thought of?
EDIT: To simply summarize my problem:
The problem is that I update the data set in the custom state when the input changes. And what I have learned by trying it out: When I change the data record in the custom state I am obviously already changing it in the database.
I can clear the custom state without any problem by clicking the “Cancel Button” but the data record is already updated in the database. I am therefore looking for a solution to update the data record in the custom state WITHOUT immediately changing it in the database.
Currently the Workflows looks like this:
-
When open the edit popup:

-
When the Input changed (This seems to be the problem. I thought that the entry would only be changed in the custom state. But it is also changed directly in the database.):

-
When the user clicks the Cancel-Button:

Best regards
Christian

