Conditional filtering

Anyone got any ideas on how to go about creating this type of data filter?

Basically, I want to user to be able to select a value from the drop-down (Is, Is not, Contains, Does not contain etc.) and then type a string in the input box to match on.

I can handle the Regex to do the ‘Is, Is not, Contains etc.’ but what I’m trying to wrap my head around is how to approach the user-selected filter type.

So the logic would be something like this:
If the dropdown value equals X then filter based on this Regex
If the dropdown value equals Y then filter based on this Regex

Any thoughts on an approach?

Hi there, @wrightj2… I haven’t worked this idea all the way through, but it seems like you could have an option set that defines the options for the dropdown, and I believe you could have an attribute on the set that defines an option’s associated regex pattern. Then, you could have conditionals on the repeating group that shows the results to change the data source based on the selected option and the option’s regex pattern. Again, I haven’t put together a working example, but it seems like this could be a way to go, so I didn’t think it could hurt to put it out there as food for thought.

Hope this helps.

Best…
Mike

Thanks Mike that makes sense, I’ll give it a go.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.