How to go from comma separated tags to a filter on one?

I have multiple comma-separated tags in a column. in the app I want people to be able to filter on one or more of the tags. What’s the best way to accomplish this?

How long is a piece of string? :wink:

Lots of ways… perhaps something like this:

  • Coerce your Tags into an array with a Split Text column.
  • Use a multi-select choice component for the user filter, and point that at a user specific column.
  • Use a Split Text column to create an array from that.
  • Now create a multiple relation between the first array and the second array (this will be in your data table)
  • Use the state of that relation as a filter - only show records where it is not empty
1 Like

So far not more than tag1, tag2, tag3, tag4, tag5 :slight_smile:
Thanks! I am gonna try!

Question, @Darren_Murphy. There’s a bit I don’t understand. So I have something like this, but how do I get to a list where the user can filter #SportsInnovation OR #FanEngagement OR #LoyaltyProgram?

ah, right. Helper Table to the rescue :slight_smile:

  • Start with a Helper Table and add enough rows to cover the maximum number of unique tags
  • Number the rows, starting from zero.
  • Create a Lookup column that targets your Tags Split column. This should give you a big array of all tags (including duplicates)
  • Remove the duplicates with a Unique Elements column
  • Sort them (if you want) with an Array Sort column
  • Use a Single Value column to pick N from start of the sorted array, where N is the row number
  • This should give you a single list of unique tags (one per row), which you can use as the source of your choice component.
1 Like

OK! I am going to try that! Thanks again!

Are you using a custom setup with a choice component on the screen, or do you want to use a native filter with the collections?

1 Like

I was thinking about native filter.

image

Here’s my setup for a collection.

1 Like

Thanks @ThinhDinh !

Instead of the single choices, I still end up with this. Any idea what i do wrong?


I see Thinh used a Split Text array. What are you using to create your array. Also, just to confirm, are you using the comma delimited list or the array as the source of the filter?

1 Like

When I do split text, this is what I get:


The only difference I can see is that you have spaces between your comma delimited values, and Thinh does not.

Yeah, ChatGPT gives me spaces

Well, I suggest at least trying it without spaces. Whether that’s telling ChatGPT to remove them, or creating a template column that replaced ‘comma space’ with a ‘comma’, and then use the template column as the source of the split text. If nothing else just to see if that’s the issue.

1 Like

I will!

1 Like

Yes, have it working now! Thanks @Jeff_Hager @ThinhDinh !

2 Likes

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