Filter Choice based on Role Owner?

Firstly, running Free version of Glide, just in case that makes a difference.

In my app I have users belonging to certain roles (organisations). I also have a choice list (in a Helper table full of various Choice lists) where I only want it to display choices in the list that the users role is allowed to see. I’m not sure how to approach this.

At first I thought have separate choice lists for each organisation for the same field and display only the one that matches the users organisation… but I can’t have multiple fields trying to write to the same field.

Then I thought maybe I have only one choice list in the helper table but beside it have related orgisation list. But then how would I tell the choice field to only show those choices where the choice organisation matches the users organisation…

… and then I thought well what if two organisations might have the same choice list meaning I would have to duplicate, so then is it better to have in the user table a column of what choice list to pick…

And then my brain blew up and I had no idea.

So bottom line is I have users belonging to organisations but those organisation MAY share the same choice list due to being a similar type (so I don’t really want to duplicate for each organisation but if I have to then I have to) and I only want to show choices that match the users organisation or organsation type.

I hope I’ve explained this clearly. :grinning_cat:

If you want to use the role here in tandem with your role/row owners setup, have a choice column and a role column (multiple text).

Write into that multiple text all roles that should have access to the choice, and set row owner to it. The roles setup will take care itself and you don’t have to worry about filtering.

Thank you for this… not sure I follow but will give it a whirl. So would I be setting up those columns in the user table or the helper table with the list of choice options or in the table that ultimately everything will be written to?

Also, I don’t see any option for Multiple Text. I tried Multiple Files but I can’t seem to write into the field.

Okay, I have all this working EXCEPT for the multiple text column… so at the moment I can’t have a choice that could be for multiple organisations…

Ahhh… I found a problem where I put the text column (as couldn’t find multiple text) in the helper table beside the choice list but of course that then flows onto any other choice that is listed in the table. So I’m thinking I need a separate table just for this choice list?

It’s a preview feature, so you need to enable it via your team settings:

It needs to look something like the below:

The tricky part for you will be writing your values into the Multiple Texts column. Because it’s an array type column, you can’t write values to it directly via the data editor - it needs to be done through a workflow or action. The way I created that example was:

  • A normal text column containing a joined list of roles for each row
  • A split text column to create an array from that
  • A collection with an item click action that set the calculated array value into the multiple texts column

1 Like

ok, thanks. Glad to know I wasn’t going blind. I’ll give this a red hot crack! Thanks @Darren_Murphy and @ThinhDinh

And confirming that I would need to have this choice list in its own table rather than in my helper table full of choices as having it in there, when I tied it out, caused other choice options to also be impacted by the organisation list

In this case, yes you should give it its own table. Primarily because of the use of row owners.

2 Likes

Thank you @Darren_Murphy and @ThinhDinh. It is now working wonderfully. Appreciate your help and guidance :grinning_cat: :clap:

1 Like

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