Glide pages: Sort data. Best experience

Hi!
How do you sort data for end users? I have different fields in my table. For example as an end user I wanna sort my data by price. Then I want to sort it by rating and etc. How to do it the best way?

Hey Igor!

See if this helps you.

So do you want to sort it by price AND rating or just price? Say if the price is equal between 2 items then show whatever has the better rating?

If you’re talking about the list sort (not the in-app sort), there would be some sort of math tricks if you want to do more than 2, else you can only sort a list by one column.

If you’re talking about the in-app sort, you can allow users to have multiple columns as choices to sort by, but not using more than one at a time.

1 Like

Yes, I’m talking about in app sort. How to design it the best way for users and how to make it in Glide.

For example I will use Choice and Collection components with Rating and Price ↑↓.

  1. How to make my Choice component change Collection component sorting?
  2. How to show all items with price lower then 50$?

A simple way to do this is to use two Collections, with each sorted in the opposite direction. And then use a user specific column to toggle the visibility of each. eg. if checked, collection A is visible, if not checked then collection B is visible.

Create an if-then-else column. If price is less than $50, then true. Use that column as the filter.

1 Like

Wow. Nice. Thank you.

Yes, it works. But how can user set the price from form or Choice component?

P.S. Still feeling like I don’t really understand Glide workflow.

Okay, so lets say you have a choice with three options: $20, $50, $100

  • Write that choice to a User Specific column
  • Use a Single Value column to apply the selected value to all rows
  • Now adjust the if-then-else column slightly:
    – If Price is less than Single Value, then true
  • And now filter in the same way… where the if-then-else column is checked

But what if my user is an anonymous visitor? I plan to use price filter mostly this way.

It will still work. The only difference with a user that is not signed in is that any selections that they make will not persist across multiple sessions.

1 Like

I’m doing something wrong, because I can’t see my User specific column in fields where I can write to.


It looks like the source table for your screen is not the People table.
You’ll need the User Specific column in which ever table that screen is attached to.
You can then use a Single Value column in your People table to apply the selection to all rows.

I checked many times. It’s People.

That’s the source of the form container, not the screen.

You probably shouldn’t be using a form container there anyway, unless you’re planning to add a new row.

Thank you! It works. Can we replicate this behaviour with text entry?

Yes.

Thank you Darren.

Can we make custom search field at the top instead of standard search (that is not visible)?

As I understand it’s again User Specific column, but where to search?

Yes, you can do that and there are several different approaches.

Here is one approach that I quite like, that is very simple.

  • Use a text input component and target it at a user specific column
  • Use a single value column in the table you wish to search that takes the user specific column value and applies it to all rows
  • Add an if-then-else column to the same table:
    – If single value is empty, then true
    – If [search column] includes single value, then true
  • Now use an inline list/collection, and filter it where the if-then-else column is checked.

I want to search all table like standard search does. Is it possible?

That’s not what “standard” search does.
Search in Pages is enabled at the component level, and only searches the data that that component refers to - not all tables.

But yes, if you wanted to search across multiple tables using this technique, it is possible. Probably the simplest way would be to add an extra collection for each table to be included in the search.

1 Like