Skip to main content
All CollectionsData sources
I can't use a computed column from my SQL source to sort a collection
I can't use a computed column from my SQL source to sort a collection
Updated over 7 months ago

I can't use a computed column from my SQL source to sort a collection

If you're experiencing issues with sorting a collection using a computed column from your SQL source in Glide, it's important to understand that this limitation comes from SQL at the moment. Glide currently does not support sorting by computed columns directly sourced from SQL.

To work around this limitation, you have two primary options:

Option 1: Use an Action to Write Results to a Basic Column

You can use an action within Glide to write the results of your If-Then-Else statement into a basic column. This process involves setting up an action that evaluates your logic and stores the resulting value in a non-computed, or basic, column. Once the data is written to a basic column, you can use it to sort your collection in Glide.

Option 2: Create the If-Then-Else in Your SQL Data Source

Alternatively, you can construct your If-Then-Else logic directly within your SQL data source. By writing this logic in SQL and displaying the resultant column as a basic column in Glide, you enable sorting on this column. Essentially, you will create the necessary computed data within SQL and expose it to Glide as a static value that can be sorted.

Did this answer your question?