Can't use "includes" when referencing array column

Creating this as a bug, but maybe it’s a feature request… (or maybe I just haven’t figured it out)

I have a Private Pro app, and I’m using Roles, which is configured as an array column.

So in my User Profiles table, I have something that looks like this:

Name Email Role 1 Role 2 Role 3
Fred fred@example.com Admin Manager User
Joe joe@example.com Manager User
Mary mary@example.com User

Now, I want to use my Roles to control tab visibility, and (for example) I have a Tab that I want only to be visible to Managers.

What I would expect to be able to do is create a visibility condition as follows:

  • where Role includes Manager (ie. address the array column directly)

But I can’t - because the only options available with an array column are is empty or is not empty.
So I’m forced to address each column in the array individually and do:

  • where Role 1 is Manager or Role 2 is Manager or Role 3 is Manager

UGH! :confounded:

I’m hoping that I’ve missed something - have I? :thinking: :pray:

2 Likes

Have you tried to create a joined column and then split them to achieve the is included? I know that its not the optimal way but should work

1 Like

Or a template column, since this is probably just multiple columns on the same row.

No, that doesn’t work.
I think there is a general problem here, where you can’t use includes when referencing an array column…

Same thing if I try to reference the Role (array) column directly:

It seems that Glide is treating an array column as a relation in this context, which just seems intuitively wrong, no?

(I’ve updated my original topic description)

Yeah you are correct on the points regarding the array, only a template column would help in this scenario I believe.

How?

A template column like “R1-R2-R3” then replace by your 3 roles columns, use include accordingly. Would it work?

oh, I see what you mean.
Yeah, looks like that works. Seems like a horrible kludge, though.

1 Like

Yes, we need to add includes as a predicate on array types!

6 Likes

Please! Cenrtantly the solution the template column is cool for the moment but would be okey to have an include in arrays