Transferring objects inside a repeater between screens

I want to make checkbox selections on the first page of prototype (first column of my repeater) and carry over the selected values (text from the second column of my repeater) to the 2nd page of prototype.

Currently on the last selection is carried over to the 2nd page Repeater_SelectedValueofRow.rp (122.6 KB)

I then want to be able click on a back button from the 2nd page and return to the first page. OnPageLoad I want the checkbox selections I made initially to be selected within the repeater.

Currently all the rows are selected.

Hi Daniel,

To transfer repeater data from one page to another, you’ll want to use global variables and the “Add Filter” interaction. Here’s where my colleague Tuomas goes into more detail about this:

Since you’re using checkboxes, however, this will be a bit more tricky. OnSelected of the checkbox, you’ll first want to update an empty repeater column with a value to match the corresponding item. And since updating a row refreshes the entire repeater, you’ll also need to update the OnItemLoad of the repeater so that it saves the checkbox selection on refresh. And it is within the OnItemLoad that you can save the value of each row to its corresponding global variable. The next page will include a duplicate of the same repeater data and you can just add an OnLoad to filter the repeater based on the selections (variable values) from the previous page. Please note, however, that the more repeater data there are, you will also need as many global variables. In the event you are planning to carry over multiple repeater items, then the solution my colleague Anthony posted below may be a better option:

At any rate, I’ve edited your file to demonstrate the first option of filtering the repeater using global variables to reference each row. Hope it helps!

Repeater_SelectedValueofRow_EDIT.rp (129.9 KB)

I tried running your edited file.

I was not able to select any of the checkboxes - any idea why?

Hi Daniel,

Hmm, I’m able to select the checkboxes on my end. Here’s a screencast to demonstrate what I’m seeing on my end:

In the event you’re trying to check the individual checkboxes, you might see that the checkboxes do not select since I gave the the entire “RepeaterRow” group the OnClick to set the checkboxes to selected, rather than just the individual checkboxes. If you wanted just the checkboxes to be selected, you can copy & paste the OnClick of the “RepeaterRow” group to the OnSelected and OnUnselected event of the checkbox widget instead.

I edited your file again to demonstrate this. Let me know if I misunderstood, though!

Repeater_SelectedValueofRow_EDIT-UPDATED2.rp (130.2 KB)

My bad, i see now that the selection is on the row not on the checkbox itself.
Your last edited file didn’t load had an error loading for some reason.

The second part of this issue was:

I then want to be able click on a back button from the 2nd page and return to the first page. OnPageLoad I want the checkbox selections I made initially to be selected within the repeater.

Any idea how I would do that?

Hi -
In regards to your the “second part”, one-option is to:

  • onClick of “Back” DON’T clear the “Selection1, Selection2, etc.” variable values…again, keep these values.
    then…
  • add cases with conditions that if the variable(s) have a value, then set the respective row as active.

I updated your original posted file…see below:
Repeater_SelectedValueofRow_EDIT-UPDATED.rp (131.0 KB)

*Just FYI - I also had to change the repeater 'onLoad" cases from “else” to “if”

Anyways, hope it helps.
TG

Hi Daniel,

Sorry about that! I’ve uploaded the file again to my post that should open as expected. Could you try downloading the file again to see if that opens up on your end? And to note, the uploaded file was edited using the file from thatguymc’s post (ty!).