Setting global variable to contents of a particular Repeater cell

Hi, I’m hoping someone can help me resolve an issue I have where I need to set a global variable to the contents of a particular cell in a repeater table.

For example I have a repeater with the 5th column set up to contain dates. The repeater contains 5 rows and I need to set the variable called Alert_Date to the date value in column 5 row 3.

I’m struggling to find a solution to allow me to do this and any help would be appreciated.

Regards
Alan

How you do this depends on whether the trigger to change the variable is initiated from inside or outside the repeater.

If you have, for example, a button in the repeater row called ‘Choose This’, you can use repeater references to fetch the text contents of the repeater data item that sets the text in that particular widget. So for example, you might add an OnClick action to ‘Button’ that sets variable value ChosenDate to [[Item.Date]].

If the trigger is outside the repeater (i.e. a button that says ‘Select Date’ that you want to retrieve a known row’s date), you’ll need something that will match the correct row and retrieve [[Item.Date]] from the row. The way I usually do this is to add a column called RowID and give every row a unique identifier of some kind, so that I can still retreive the value even if the order of the repeater is changed by sorts or filters I’ve applied.

So in that case, clicking the button would Set Variable Value ‘ChosenDate’ to [[Item.Date]] where [[Item.RowID]] equals the row you want.

If you’re still struggling, upload an example RP file.

1 Like

Thank you very much Dave.

1 Like