You can do this, but the solution isn’t straight forward. Axure doesn’t provide a built-in way to query specific rows in a repeater (e.g., a property like [[MyRepeater.Row.3.Column1]] or a “Get Column Value” action.) Instead, you can devise a “listener method” in which you set up a way to identify a “target” row–maybe it is “the third row” or maybe it is “the row with account number 69”–and then “ping” a widget in the repeater, so each and every instance (row) “listens” to the ping and responds if it is the target row.
If the discussion below is too complicated or you can’t get it to work, I’d be happy to demonstrate it for you if you can upload a sample .rp file with your repeaters set up.
I have used two ways to create a “repeater listener method”:
- Utilize an otherwise unused event for a widget in repeaterB, like Moved or Rotated.
A. Clicking an “Update Row” button in repeaterA can set the “target” and initiate the “ping” …something like,
Set Variable Value OnLoadVariable (or whatever global variable) equal to text on MyInputField
Add Row to This, column AccountNumber, to OnLoadVariable
Move textWidgetName by (0, 0) //Just some widget in repeaterB; it doesn’t actually get moved, just a way to trigger the Moved event. You can also call “Fire Event Moved for textWidgetName”
*Keep in mind that “moving” a widget in a repeater will move every row’s instance of that widget (in very rapid succession from row 1 to row N) so you’ll need a way to test each row to see if it is a target row.
B. For this widget in repeaterB, (maybe it holds the text for “AccountName”) set up a way to “listen to the ping” via a Moved action which updates your new row in repeaterA, but only if it is the target row. Use a conditional case to test if it is the target row:
If [[Item.AccountNumber]] equals value of OnLoadVariable
Update Rows
in RepeaterA where [[TargetItem.AccountNumber == OnLoadVariable]]
set column AccountName equal to [[Item.AccountName]]
set column FundNumber equal to [[Item.FundNumber]]
set column FundName equal to [[Item.FundName]]
- An alternate approach, instead of using an event like Moved is to use the Update Rows action and a column specifically for the purpose of returning a value or data from the repeater dataset (or states of any widget therein.) The basics are the same as approach 1, but the code to handle things is in the repeater’s Item Loaded event, instead of a widget in the repeater.
A. To use the data in a row with account number of 1002, call something like,
Update Rows
in repeaterB
[[TargetItem.AccountNumber == ‘1002’]]
set column DataReturn equal to “true”]]
B. In the Item Loaded event in repeaterB, set up a conditional case to “return the data” when the value of the column named DataReturn is “true”. In your case, this means updating the newly added row (or any row with a matching account number):
If [[Item.DataReturn]] equals “true”
Update Rows
in RepeaterA where [[TargetItem.AccountNumber == Item.AccountNumber]]
set column AccountName equal to [[Item.AccountName]]
set column FundNumber equal to [[Item.FundNumber]]
set column FundName equal to [[Item.FundName]]
Update Rows
This row
set column DataReturn equal to “false”
Approach 1 is more commonly used–I learned it from the infamous Gregor on this forum many years and RP versions ago RP6?–and you’ll find many forum threads describing this. It is pretty much a hack, is limited in its scale (only so many unused events; and if you later need to actually move a widget for real it can break) …but it does work.
I devised the second approach (and it may not be original) a few years ago to help a broader team understand and collaborate easier on a team project. It feels more “official” --less of a hack–and makes the act of “calling a target row” easier, as well as making the code more visible as it is in Item Loaded and not hidden in a random event of some widget. It should be more extensible/scalable as you can add additional columns and cases for different types of “returns” or actions.