Repeater widget calculations based on dropdown selections

Hi all,
First time poster. Apologies if this has already been posted somewhere. I could not find anything.
I’m trying to create calculations within each row/item of a repeater.
The calculation is Severity x Probability x Exposure (all three are drop downs with text options) = Inherent Risk.
For each of the drop downs I have created a corresponding text widget (SeverityScore, ProbabilityScore, and ExposureScore respectively) to interpret the value of the drop down option, e.g. “Very low” = 1, “Low” = 2 etc…
My issue is that the Inherent Risk widget doesn’t display a proper result after choosing all my drop downs, UNLESS I physically click into the ExposureScore field (far right) and then cilck out of it. What I would like is for the Inherent Risk field to update immediately whenever I select values from the 3 columns on the far left of my file attached.

Any help would be appreciated.

Risk.rp (69.7 KB)

Side note - anyone know why after selecting a value from the dropdown field in a repeater, it requires 2 clicks on a different dropdown in order for it to show its options? I presume it’s the Lost focus stuff I have on each widget (I added these to retain fields inputted by the user for previous rows).

A lot of what you’re seeing stem from how a repeater’s “order-of-operation” of works and what is actually going on when they “update”.

First, before I forget: Risk.rp (125.0 KB)

The first thing to understand is that repeater rows don’t “update”, the whole repeater re-renders. This means that whenever a value in a repeater changes, no matter where it is visually displayed (first row, last column, middle cell, whatever), the entire repeater is wiped from the screen and rebuilt from the beginning. This includes any interactions that are involved in the process.

So the reason why the risk score isn’t updating is because the trigger even to change it never happens, the repeater “starts over” before it gets there. Something similar is happening with the dropdowns needing 2 clicks. As soon as a dropdown looses focus, the repeater updates, completely removes the dropdown that was there and replaces it with a new one. The new one doesn’t have focus, because, technically, it has never been clicked before.

This “rebuilding” that repeaters do can also cause them to load “slower” than other parts of the page. So if there’s an action that is depended on something inside a repeater, you might need to add a few millisecond wait to it to give time for the repeater to finish.

Thanks heaps, huban. What you did makes it work perfectly. The key differences I see in your file is that you added a first case to each of the drop downs to be performed no matter what (TRUE), and the “Lost Focus” interaction is gone. I understand your explanation on focus but I will need to really study it to see how it re-renders chronologically.

Thanks again for your help. Much appreciated. :grinning: