If statements in repeater functions/variables

Is there a way to write conditional logic into functions for the repeater?

I have three columns of text one of which is the output of [[Item.Impact * Item.Likelihood]], what i’d like to achieve is if the result is <10 to add a text string to the column, if it’s >10 add a different one and so on.

You can add a case statement to the OnItemLoad event with that conditional. To “call the function” just update the repeater. You can also create columns in your repeater sheet just for special functions, along with a case statement in OnItemLoad. For example, a column named “Importance” and a case with “If [[Item.Importance]] equal to “calc” “. To call the function for all rows, just update All Rows in repeater to set text of Importance to “calc”. Or update only one or several rows with conditional in the Update Repeater action. If you want to do something like sum all the rows, out your case statement in the OnLoad event for the repeater, which will get called after all the items have loaded. To call that function, use the Fire Event : OnLoad for the repeater.

Or, you can create function-like capability by adding your actions to an otherwise unused event for your text widgets in the repeater. The OnMove (e.g, Move This by (0,0) ) and OnRotate events are usually good for this. Keep in mind that if this is called from outside the repeater, every instance of that widget (for each repeater row) will be moved, which in your example may be good. To call a specific row, you’ll need to have the OnMove event check against some defining property, like “If [[Item.index]] is equal to [[MyTempVar]]”. So if you want to call the function only for row 5, you’d first set MyTempVar equal to 5, then move the widget in the repeater by (0,0).

Thanks.

The column of data looks like Critical (87), Minor (10), Significant (15) and the number is the result of [[Item.Impact * Item.Likelihood]] from another repeater column. I can’t see how I could use a case statement OnItemLoad because the target object isn’t consistent.

I can say if this, do that, to this object, rather than if a string of cell of data is this, do that to this one example but do something else to the next string in the repeater table. If you see what I mean.

Ha… umm, no I don’t see what you mean. Could you post your .rp file?