Repeater duplicates

Hi! I am new to Axure and am struggling with duplicates in a repeater. I would like to either add a row the repeater, then clean it up by removing the duplicates or only add to the repeater should any of the rows in the repeater do not contain a specific value which I have set as a global variable.

Any help would be appreciated!

Hi!

The second tact you mention is the better one. Sadly, there is no function to query a repeater to say, “does this column contain this value?” (Come on, Axure folks!)

Instead, you must jump through a couple of hoops using the listener method. (If you Google “axure repeater listener” you will receive many examples. You will need to do this to understand what’s going on.) Feel free to ask questions if you don’t understand this listener method. It’s unfortunate that this hack is necessary,

Here you simply want to avoid adding a value if it exists. So here’s a way to check if it exists, and then add the item if not.

Live sample

File: add_unique_to_repater.rp (56.2 KB)

1 Like

Thank you so much for the response! I was able to accomplish what I was looking for exactly as you mentioned. It seems that Axure should add the ability to filter for duplicates and remove or at least not display the duplicates in the repeater. Maybe someday!

Thank you so much for this example. However, nothing happens when a duplicate is entered. Can you display a popup message instead? I just can’t figure out how to do that.

Hi!

You would need to add a condition to the button. If you are unfamiliar with conditions, Axure provides this help page.

I updated the file to show an example.

File: add_unique_to_repater.rp (57.1 KB)

Thank you! Thank you! That’s exactly what I was looking for. I will check the help page on conditions.
There is one more thing I am having trouble with. How do I add a label or text box on the page that displays the a count/number of records that exists in the repeater. That number should increase/decrease as I add records in the repeater?

Hi!

itemCount give you the count of all rows currently displayed. In On Item Loaded you can add a the following line:

On Item Loaded (of repeater)
  ....
  Set text on (text box on the page) to value [[Item.Repeater.ItemCount]]

Thank you so much. You guys are awesome