Filter Interference

Hi all,

I’m experiencing an interference by a filter.

My goal is

  1. in Repeater 2: onClick on Item → add a row in Repeater 1 with some data transfer
  2. in Repeater 2: onClick, update row → isSelected = ‘True’
  3. in Repeater 2: filter out isSelected = ‘True’ so that the previously selected Item can’t be clicked again.

Steps 1 and 2 are ok when the filter is OFF. However, when I add the filter, step 1 fails and a row is not added. When I take the filter off, it works again.

Do you know what could be causing this?

Example Move between Repeaters_v0.2.rp (492.3 KB)

I can get the desired behaviour by removing the filter in the onClick (just before the add row to Repeater 1). But I guess it would be good to know why the add row doesn’t work when there’s a filter applied.

Are you adding a row that does not meet the criteria of the filter, and is therefore hidden as soon as it is added?

Hi nkrisc,

There is no filter on Repeater 1, just Repeater 2. In addition, it’s not an issue with items being hidden, it’s that clicking on a visible item does not produce the desired behaviour.

Somehow (as I understand it), having the filter on is preventing the Add Rows to Repeater1 command.

Hi Mactuarchitect,

I took a look at the file and I believe I see what is happening. OnClick of your repeater items in repeater 2, you are Updating the repeater row to have isSelected equal to True in one case, and moving the addFunction hot spot (which adds the repeater row to repeater 1) in a separate case. The action that adds a new row to repeater 1 seems to be relying on the value [[Item.Column0]] from the clicked row in repeater 2; the reason the row add seems to break when the filter is on is that when the repeater 2 Updates to set isSelected to True, the repeater is redrawn, and that row is filtered out before the “Move addFunction” action fires. When that action does fire, repeater 1 can’t find the row from repeater 2 to pull its data for adding the value from [[Item.Column0]].

It looks like moving the “Add Items” case in front of the “No conditions” case and making both “If” statements should help to keep the filter in place and add the rows. Hopefully that does the trick!

1 Like

Holy cow it works!

I had to read your reply a few times, but I finally understood on the third go.

Sorry I didn’t reply sooner, but I found a workaround by removing the filter and then applying it again immediately.

Is there documentation about when certain events occur? I seriously could not have thought that the redrawing would occur in the middle of an OnClick event. I think I may have committed other similar mistakes without ever finding out the cause. What would be useful is a list of common mistakes, such as this.

Anyway, this has been an eye opener. Thanks so much Alyssa.

Is there a “mark as answer” function in this forum?

Hi Mactuarchitect,

There isn’t, however I can see how that would be useful to have! I’ll pass your suggestion along and we’ll be able to see what we can do in that area.

1 Like