# How can i sort list with value from button?

**URL:** <https://community.glideapps.com/t/how-can-i-sort-list-with-value-from-button/81766>\
**Category:** Ask for Help\
**Created:** [May 8, 2025, 12:16am UTC](https://community.glideapps.com/t/how-can-i-sort-list-with-value-from-button/81766 "2025-05-08T00:16:59Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryanp](https://avatars.discourse-cdn.com/v4/letter/r/7ea924/32.png) [@ryanp](https://community.glideapps.com/u/ryanp)\
**Post date:** [May 8, 2025, 12:16am UTC](https://community.glideapps.com/t/how-can-i-sort-list-with-value-from-button/81766/1 "2025-05-08T00:16:59Z")

</div>

Hello, im trying to use a list of buttons at the top of a page and have the list display values that match the value of the button. In essence using the buttons as a sub menu or pill list. i have not been able to see how to send a value to the list from a button press. Is this possible without creating a page for each button?

---

<div class="post-metadata">

**Author:** ![Nicolas\_Joseph](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nicolas_joseph/32/76105_2.png) [@Nicolas\_Joseph](https://community.glideapps.com/u/Nicolas_Joseph)\
**Post date:** [May 8, 2025, 1:07am UTC](https://community.glideapps.com/t/how-can-i-sort-list-with-value-from-button/81766/2 "2025-05-08T01:07:23Z")

</div>

Hello @ryanp 🙂

Just to be sure we understand correctly - are you trying to filter values in a list using buttons?  
Something like this, for example:  
 ![Filtering list using buttons](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/e/6e0e2ab85c9e3ec20e2361c880919b4f34e3ea30.gif)

If that’s the case, how many buttons are you planning to include? 🤔

---

<div class="post-metadata">

**Author:** ![ryanp](https://avatars.discourse-cdn.com/v4/letter/r/7ea924/32.png) [@ryanp](https://community.glideapps.com/u/ryanp)\
**Post date:** [May 8, 2025, 4:03am UTC](https://community.glideapps.com/t/how-can-i-sort-list-with-value-from-button/81766/3 "2025-05-08T04:03:59Z")

</div>

Yes, exactly i have between 6-8 buttons

---

<div class="post-metadata">

**Author:** ![Nicolas\_Joseph](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nicolas_joseph/32/76105_2.png) [@Nicolas\_Joseph](https://community.glideapps.com/u/Nicolas_Joseph)\
**Post date:** [May 8, 2025, 5:48pm UTC](https://community.glideapps.com/t/how-can-i-sort-list-with-value-from-button/81766/4 "2025-05-08T17:48:25Z")

</div>

Okay, here’s the step-by-step procedure. Be aware that there may be a better way: count on my colleagues to enlighten you on this point if necessary 😛

> **Requirements**
> 
> - 2 columns per _filter_ in the `Users` table
> - 1 column to aggregate everything in the `Users` table
> - 4 columns in the `Products` table (or equivalent)
> - 1 workflow per _filter_

  

**In the `Users` table** 👇

1. Create a _Boolean_ column for each filter you want. You’ll store here the value of the filter (like a switch). In this example, we have `Trains?`, `Cars?`, `Bikes?`, and the configuration is very simple:  

2. Create a _If → Then → Else_ column. Again one for each filter. It’s an easy way to display the value to the user. We use a little trick with emojis for that:

3. Create a _Make Array_ column, `Array of pills` in this example.  

  

**In the `Products` (of course, you will adapt to your specific case) table** 👇

1. Create a _Query_ column - `Active user` - to make sure the filters depend on the signed-in user.  

2. Add a _Lookup_ column (`Array of pills`) to obtain the array we created previously for that specific user.  

3. Assuming you already have the Category available in the table, create a _Template_ column to concatenate the “yellow circle emoji” with the category name. This is `Category with emoji` (yeah, I know, amazing naming convention 😃 )  

4. And lastly, we’ll get to know if the row is part of a selected category thanks to a _If → Then → Else_ column `Category selected?` that compares the value of each row to the real value of the filter.  

  

**In the Layout** 👇

1. Add you collection (_List_, _Card_, _Table_, whatever you want) and use `Products` table as source. Go to Options \> Filter Data \> Category selected? is checked  

2. Add a _Button block_ component. To my knowledge, it’s the only way to nativly force all elements to be on a single row (from left to right, without line break). Maybe in your case, you could go for 2 different components, one on top of each other, for UX purpose. That’s why I asked you the number of filters. Up to 8 in a single row might not be very elegant 🤔 You’ll choose of course!

3. Add one Action per filter you’ll use to the _Button block_ component. Here there are 3 filters so 3 actions. You can already change _Style_ and _Options_ if you want and also the _Title_ of each action to bring back the values from `Trains pill`, `Cars pill` and `Bikes pill`:  

  

**In Workflows** 👇

1. Add a new workflow and select _App interaction_  

2. Change the name to something more logical like `Trains` and select `Users` as datasource table.  

3. Now, we are going to apply the “switch” and create a 2 branches workflow. One will be executed when the filter is ON (and must become OFF) and one will be the exact opposite. Click on the + sign to _Add condition_ and define the condition to be _User profile \> Trains? is checked_. Then click on _Add else_.  

4. Add a _Set column values_ action below the first condition and change the row to be the User profile \> User profile row. Because we are in the _Trains_ workflow when the filter is already ON, we have to change it to OFF so we just write _false_ in Trains?  

5. Proceed exactly the same way to create a workflow for Bikes and another one for Cars (so again, up to 8 in your case). The _Duplicate_ option is very helpful here and avoid a lot of mistakes so don’t miss it!  

  

**Lastly, back to Layout** 👇

- Change the Action associated to each button to Workflow for Users \> Bikes (or Cars, or Trains…)  
 ![Workflows and buttons](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/1/e178f24cbc41aa40045c615393ab0a2bb9204a10.png)

  

Everything is now OK and you can enjoy playing with your filters 🥳

The content of this post may seems scary due to it’s length but honestly, it doesn’t take long because you duplicate many things (columns, workflows, buttons…).  
I’m pretty sure there are some improvments to find but this will be for another day 😃

Hope that’s what you expected!

---

<div class="post-metadata">

**Author:** ![ryanp](https://avatars.discourse-cdn.com/v4/letter/r/7ea924/32.png) [@ryanp](https://community.glideapps.com/u/ryanp)\
**Post date:** [May 8, 2025, 10:02pm UTC](https://community.glideapps.com/t/how-can-i-sort-list-with-value-from-button/81766/5 "2025-05-08T22:02:06Z")

</div>

You are the man thank you

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [May 8, 2025, 11:58pm UTC](https://community.glideapps.com/t/how-can-i-sort-list-with-value-from-button/81766/6 "2025-05-08T23:58:46Z")

</div>

If it acts just like a submenu and you can only have one section selected at once, Glide has a prototype in private beta that does exactly that, with you only having to configure a query based on the chosen value for it to work.

 ![CleanShot 2025-05-09 at 06.58.09](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/2/627b243a4ded3721d287d3cd6c09bd49824ee3c7.png)

I don’t see any problems with it after a few days of using, though I don’t have information on when it would come to production.

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [May 9, 2025, 7:58am UTC](https://community.glideapps.com/t/how-can-i-sort-list-with-value-from-button/81766/7 "2025-05-09T07:58:50Z")

</div>

It’s interesting that you chose to store the filter values as global values in the users table and not as user-specific values in a helper table.

Any reason why you opted for one approach rather than the other?

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [May 9, 2025, 8:07am UTC](https://community.glideapps.com/t/how-can-i-sort-list-with-value-from-button/81766/8 "2025-05-09T08:07:23Z")

</div>

> [@nathanaelb](#):
>
> It’s interesting that you chose to store the filter values as global values in the users table and not as user-specific values in a helper table.

I do that quite often. Especially if I think I might end up using those same filters elsewhere.

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [May 9, 2025, 10:46am UTC](https://community.glideapps.com/t/how-can-i-sort-list-with-value-from-button/81766/9 "2025-05-09T10:46:36Z")

</div>

> [@Darren\_Murphy](#):
>
> Especially if I think I might end up using those same filters elsewhere.

I’m going to be pondering this for days.

My train a thought.

A user-specific column seems to be 3 columns under the hood: the record’s row ID, a user row ID and a value.

_If_ a user-specific value isn’t actually an attribute of the record and it’s a user’s preference (such as for this onscreen filter), then really a user-specific columns is now only 2 columns under the hood: a user row ID and a value. We could imagine the data of user-specific columns lives (under the hood) in the users table with row ownership applied to the row and it is displayed in other tables as a relation+lookup in one column (again under the hood).

Data in user-specific columns cannot be used globally within the app. Data in the users table is easily accessible throughout the app.

Based on the above and if it is correct, I’m trying to think of the cases when I should be using user-specific columns and the ones when I shouldn’t.

Back to the thread. Without giving it much thought I would have it used user-specific columns. I’m definitely not saying it’s better. I’m trying to determine if one approach is indeed preferable and if so why.

I’m going to sleep well tonight! I can’t wait.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [May 9, 2025, 10:51am UTC](https://community.glideapps.com/t/how-can-i-sort-list-with-value-from-button/81766/10 "2025-05-09T10:51:44Z")

</div>

> [@nathanaelb](#):
>
> Data in user-specific columns cannot be used globally within the app. Data in the users table is easily accessible throughout the app.
> 
> Based on the above and if it is correct, I’m trying to think of the cases when I should be using user-specific columns and the ones when I shouldn’t.

Perhaps I should clarify. I do both. That is, I use User Specific Columns in the User Profile row.  
I know that it’s totally unnecessary to make them User Specific, but I do it to give myself a visual cue that such columns don’t hold “actual” data, but rather temporary/transient values that are used for filters, navigation, etc. It’s also a hangover from my days using Google Sheets where I didn’t want these types of columns creating clutter in my Google Sheet.

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [May 9, 2025, 11:01am UTC](https://community.glideapps.com/t/how-can-i-sort-list-with-value-from-button/81766/11 "2025-05-09T11:01:34Z")

</div>

> [@Darren\_Murphy](#):
>
> That is, I use User Specific Columns in the User Profile row.

I should clarify too then. I’m pondering about global values in the users table and user-specific values outside of the users table.

I still find all of these considerations not all that easy to work with, so the clearer my mental models the easier it is the build.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [May 9, 2025, 11:20am UTC](https://community.glideapps.com/t/how-can-i-sort-list-with-value-from-button/81766/12 "2025-05-09T11:20:30Z")

</div>

Yeah, I also use the User Profile row to store globals. In fact I usually have a whole group of columns that I will prefix constants/  
In those columns I’ll store things like the AppID, webhook URL’s and the like - static values that I might need to access from anywhere in the App.

For quite a while a few of us have been requesting a dedicated table type for this purpose, or at least some mechanism for defining and storing global constants that can be accessed from anywhere.

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [May 9, 2025, 3:19pm UTC](https://community.glideapps.com/t/how-can-i-sort-list-with-value-from-button/81766/13 "2025-05-09T15:19:42Z")

</div>

Oh gosh, I need to clarify again. What a mean by “global value” is a value that is non-user specific, a value that can be ready by any user of the app.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [May 9, 2025, 4:13pm UTC](https://community.glideapps.com/t/how-can-i-sort-list-with-value-from-button/81766/14 "2025-05-09T16:13:07Z")

</div>

Yes, I understood that. And it’s also what I meant 🙂  
In the examples I gave, the values are stored in template columns, and so are available to all signed in users. Along similar lines, I often have a series of date math columns in the user profile row that return commonly used date values - 1 week ago, 1 month ago, etc.

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [May 9, 2025, 6:59pm UTC](https://community.glideapps.com/t/how-can-i-sort-list-with-value-from-button/81766/15 "2025-05-09T18:59:07Z")

</div>

> [@Darren\_Murphy](#):
>
> In the examples I gave, the values are stored in template columns, and so are available to all signed in users.

Gotcha. Using `template` columns for these is a good tip, I’ll use it 🙏

---

<div class="post-metadata">

**Author:** ![Eric\_Penn](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/eric_penn/32/73888_2.png) [@Eric\_Penn](https://community.glideapps.com/u/Eric_Penn)\
**Post date:** [May 9, 2025, 8:03pm UTC](https://community.glideapps.com/t/how-can-i-sort-list-with-value-from-button/81766/16 "2025-05-09T20:03:12Z")

</div>

> [@Darren\_Murphy](#):
>
> For quite a while a few of us have been requesting a dedicated table type for this purpose, or at least some mechanism for defining and storing global constants that can be accessed from anywhere.

Put them on a 1 row table and copy them with single value to User Profile… then it works for all users signed in or not. Very valuable trick.. reduce app bloat and make life a little easier

This means that any piece of data could be used globally. So if you need some value before sign in… calculate on 1 row table… instead of user table. Think about it 😉

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [May 9, 2025, 11:19pm UTC](https://community.glideapps.com/t/how-can-i-sort-list-with-value-from-button/81766/17 "2025-05-09T23:19:51Z")

</div>

Yeah, I’m familiar with that approach. I don’t really like it. It’s always seemed like un-necessary duplication to me. I almost never build Apps where users aren’t signed in, so in my view it’s easier and simpler to put everything in the User Profile row.

---

<div class="post-metadata">

**Author:** ![Nicolas\_Joseph](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nicolas_joseph/32/76105_2.png) [@Nicolas\_Joseph](https://community.glideapps.com/u/Nicolas_Joseph)\
**Post date:** [May 10, 2025, 12:16am UTC](https://community.glideapps.com/t/how-can-i-sort-list-with-value-from-button/81766/18 "2025-05-10T00:16:30Z")

</div>

> [@nathanaelb](#):
>
> Any reason why you opted for one approach rather than the other?

Easy one @nathanaelb: I don’t see any advantage to use _User-specific_ columns (_USC_ after that) rather than storing data in Users table when you have _Sign-in users_:

- no access to data stored (as far as I know) which means **no ability to get stats or analyses** after the fact;
- you must define if it’s a _USC_ or not when you create the column. In my experience, it can be **difficult to evolve the data model and/or functionalities later** , especialy if you want to give a smooth user experience;
- till now, I **haven’t seen any drawbacks** (such as bad performances) with Users table’s option.

  

⚠ Once this has been said, I’m sure I’m not enough experienced to make this statement a general rule and it relies on your context. Several Gliders who are references in my eyes use them, there must be a good reason for that - which I have not yet encountered 👍

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [May 10, 2025, 8:52am UTC](https://community.glideapps.com/t/how-can-i-sort-list-with-value-from-button/81766/19 "2025-05-10T08:52:13Z")

</div>

I see a good reason to use user-specific columns for custom forms, calculators, and to set a user-specific value of the attribute of an item (such as a star rating of an item). Those are my main use cases.

That being said:

**Custom forms**  
I avoid these. I know they are more versatile and more advanced than Glide’s native forms, but I’m comfortable using Glide’s native features. Given the choice, I will shy away from complexity.

**A user-specific value of the attribute of an item**  
This is an interesting one. Until now I had never questioned this. I had always accepted that user-specific data cannot be used globally throughout the app for other users or for stats. However, if as you suggest a user-specific value were stored in the users table instead (always, no matter what), it would circumvent the limitation of the user-specific columns. Granted, that user-specific data would then be stored in a separate table.

I think using a user-specific column for a calculator is a natural approach which isn’t particularly complex.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [May 17, 2025, 8:52am UTC](https://community.glideapps.com/t/how-can-i-sort-list-with-value-from-button/81766/20 "2025-05-17T08:52:23Z")

</div>

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