What reusable options do I have to increase one of multiple decimal attributes using buttons?

0
I have a Data View with the Checklist entity as its data source. The Checklist entity contains 10 decimal attributes (Time_1, Time_2, Time_3, …).Inside the Data View, I display a table with rows and text boxes for each of these decimal attributes. Below each text box, I want to place three buttons: +10 minutes, +30 minutes, +1 hour (where 0.5 equals 30 minutes)Each button should increase the value of the corresponding decimal attribute.From what I’ve checked so far, if I use a single microflow for all buttons, I can’t dynamically pass which specific decimal attribute should be updated. I’d like to avoid creating a separate microflow for each button and each attribute.Is there a reusable approach for this scenario? For example, would a JavaScript action or another pattern be more suitable?
asked
1 answers
0

To avoid creating separate microflows, you can create a helper entity called TimeEditContext that has an association to Checklist, an enum indicating which field should be updated (Time_1…Time_10), and a Decimal attribute like AdjustmentAmount to represent how much time should be added. The buttons simply set the selected field and the adjustment amount, then call the same single microflow. Inside the microflow, a decision or switch structure updates the corresponding Checklist. Time attribute by adding the adjustment amount and commits the change.

answered