πŸ™πŸ˜ Add Query function to Glide Tables, Please!

Perfect!

Great to hear!

1 Like

@AymenM thanks for the question. As @Jeff_Hager mentioned, this would be different than the tutorial from @ThinhDinh. Its a great tutorial, and I love using the query function in google sheets, but as Glide Tables provides better responsiveness and higher capacity, I would want to also be able to do a query function within Glide Tables. I have an app currently that would benefit greatly from this feature!

2 Likes

@david Fantastic! Can’t wait :star_struck:

Just want to add to this…if you need a workaround for now…what I would do is first make sure you have enabled the RowID column in your sheet.

  • Then create a template with the unique key values you would normally select for a query.
  • Then create a multiple relation that links that template back to itself.
  • Then create a Single Value column to get the first RowID out of that relation.
  • Then create an IF/Then column that returns β€˜true’ if the row’s RowID matches the single value RowID.
  • Finally create any Rollup columns you need to sum data out of the relation.

This will give you data that can be filtered using the β€˜true’ column and that will have all of your summed data for each unique key.

6 Likes

This is such a powerful technique, and has so may different applications.
I use this a lot now to create filtered lists - it removes the need to apply filtering to list components.

3 Likes

@Jeff_Hager I think I understand. I will give that a try! I have a workaround right now where I manually put in the unique values for the query grouping then relate that to the data set, then rollup up those relations. That means for weekly rollups I have to manually type in a new week into the GT every week. Does this method take out the manual aspect?

Yes, it would all be automatic because it’s all in the same existing sheet. The Single value column is only pulling back one rowid from the matching set of keys and that single value will always be the FIRST matching row from the relation. That way, only one of your rows in each group will be marked as true because only one of them will have the same rowid.

1 Like

I am using dates ( with seconds) instead of row IDs

1 Like

I do have to add, that a built in solution from glide would still be better. Not only would it probably be less overhead processing, but a separate sheet would allow you to have a separate details layout since it would be a separate sheet. But that all depends on how your app is laid out. I’m still all for a native solution.

3 Likes

Is there any way we can get whole column values from the other table (not just rollup sums) at once? The objective is to get the public info only from one table into another automatically

A relation and lookup should work for that if there is a common value in both tables that you can use to create the relation.

1 Like

Are you looking for a way to side-step Row Owners using computed columns?
That’s not possible.

1 Like

Good point. Certain data protected by row owners in the user profile table cannot become public data by using computed columns such as a relation and lookup to extract the data into another table. You’ll just end up with a bunch of empty values for all users except the user that is signed in.

The only way to do this in a way that will work is to actually write the data separately to each table, or if this a google sheet, then use a query formula to pull certain columns of data into another sheet table.

2 Likes

Got it. So the only way to get the public information from row-owner-protected User Profiles is to use a Google Sheet, and it won’t be possible even through the relation + lookup right? Till now, I have been solely only using Glide Tables, so should I just make their Google Sheet equivalents? I didn’t do it till now due to performance concerns.

1 Like

Yeah, if you need a β€œPublic” version of your User Profiles table, then I think the simplest option is to move it to a Google Sheet, and then make a read-only copy using a query formula.

In terms of performance, I wouldn’t worry about that - as long as you keep all of your calculations/computations in Glide then you should be fine.

3 Likes

The only other alternative is to change your app flow, so some of the information is written to the private table and some of the information is written to the public table. You could always use the relation/lookup to bring information from the public table into the private table, but not the other way around.

The google sheet method would be the easiest, but if you wanted to stick with glide tables, then you would have to rethink your flow a little bit.

3 Likes

Thanks…Any screenshots for this?

Something like this.

thank you, let me check it out

1 Like