Hi Glide Community,
I’m building a no-code app using Glide and need help displaying a filtered collection list based on tags. Specifically, I have a page called “Diabetes Management” and want to list all the resources associated with diabetes. Each resource may have 2 to 10 tags associated with it, all stored in a single column and separated by commas.
Example:
- Page: Diabetes Management
- Resource Tags: “diabetes, nutrition, exercise, health…”
Goal: To filter and display resources on the “Diabetes Management” page that include the “diabetes” tag.
Questions:
- What is the best way to filter resources based on a specific tag?
- How can I handle multiple tags within a single column when filtering?
I think I figured it out. Please let me know if there is a better way to do it:
Filtering a Collection List by Tags in Glide
Objective: Display a filtered collection list based on an associated tag for each resource.
Steps:
- Create a Comma-Delimited Column:
- In the “Resources” sheet, create a column called
Tags
.
- Populate this column with tags for each resource, separated by commas (e.g.,
diabetes, nutrition, exercise
).
- Set Up the Split Text Column:
- In the “Data” tab in Glide, select the “Resources” sheet.
- Add a new column and choose “Split Text” as the column type.
- Name this column
Split Tags
.
- Set this column to split the
Tags
column based on the comma delimiter. This will create an array of tags for each resource.
- Create a Template Column for Page Tag in the Chronic Conditions Sheet:
- In the “Chronic Conditions” sheet, create a column called
Page Tag
.
- Use the template column type to set the template value to the specific condition (e.g.,
diabetes
for the Diabetes Management page).
- Add a Single Value Column in the Resources Sheet:
- In the “Resources” sheet, add a new column and choose “Single Value” as the column type.
- Name this column
Page Tag (Single Value)
.
- Set it to pull the value from the
Page Tag
column in the “Chronic Conditions” sheet. This ensures that the Page Tag
value dynamically reflects the page context.
- Configure the Collection List Filter:
- On the Diabetes Management page in Glide, add a collection list component.
- Go to the filter settings of the collection list.
- Set the filter to check if the
Split Tags
array contains the Page Tag (Single Value)
value. This will ensure that only resources tagged with the current page tag (e.g., diabetes
) are displayed.
Example Configuration:
- Filter:
Split Tags contains Page Tag (Single Value)
Columns Setup:
- Resources Sheet:
Tags
: diabetes, nutrition, exercise
Split Tags
: ["diabetes", "nutrition", "exercise"]
Page Tag (Single Value)
: diabetes
- Chronic Conditions Sheet:
Condition
: Diabetes
Page Tag
: diabetes
Notes:
- Ensure that the
Page Tag
in the “Chronic Conditions” sheet is correctly populated.
- Verify that the
Split Tags
column in the “Resources” sheet is correctly formatted as an array.
- Double-check the filter logic to ensure it references the
Page Tag (Single Value)
column accurately.
The Split Text is definitely the part you need. With an array created from a Split Text column, you can use it in various ways.
- Use it for a collection’s in-app filter.
- Use it to establish relations to/from another array or basic value in another table.
- Use it with ‘contains’ in a filter
- etc.
Not sure I completely follow your entire setup, but here’s a few comments.
I’m not quite sure why you need a template column if you are just replicating another value.
Not sure why this is needed either.
I’m not sure, but I think a Relation using the Split Text array may serve you better. That way you won’t need to jump through additional hoops to set up a filter, but I don’t think I have a full picture of your tables to say for sure.
thank you. I’m sure you’re probably right. I’m using ChatGPT to try to figure it out and learn while I go along.
1 Like
I would try creating a relation that uses the Split Text array. Then set the source of your collection to use that relation. Filters work too, but I tend to personally prefer using a relation. Mostly because I tend to use the relation for other things such and lookups, joined list, rollups, etc. Feels more future proof to me.
1 Like