Filtering on a repeater using multiple values in a global variable

repeater-widget

#1

What’s the best way of setting up a filter for a repeater that brings back all records that match any value in a global variable?

For example, the variable might contain a string like: “DD,FF,VV” which would be used to match on a column in a repeater called “ID” which might contain “DD” or “VV” or “XX” or “NN” etc. The values here can be anything - I’m just using letter pairs for an example.

So essentially - whatever appears in the global variable would bring back records in the repeater that match any of those values.

I’m assuming I’d need to “pre-process” the variable in some way to “feed” the output into a filter, but I don’t quite know where to start…


#2

Here you go:

Filter Lots.rp (51.0 KB)


#3

Ah! I tagged this post as Axure 9 when in fact I’ve only got Axure 8. I can’t open that file :frowning:


#4

The relevant filter rule is this:
[[filter.indexOf(item.column0) >= 0]]

Where “filter” may be either the text on a widget containing the string that you describe above, or the name of a global variable containing such text. I’m assuming (as you can see) that the relevant column in the repeater is called “column0”

Let me know if that works.


#5

Ah - that was easy! Thanks!


closed #6

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.