Hey people, I have a private app in which the managers can add users, these users will have a role, however when they create a user, by adding a new that comes from a temporary sheet, the role doesn’t add to the column, the rest of the values do, so name, e-mail etc. The funny thing is that it works fine in the editor but not in the real app, any clues why this may happen? Are we not allowed to add a value to the role’s column?
TIA
A user cannot add a role that they do not possess themselves.
Thank you David. So how come it works in the editor but not in the real app then? And is there a way to give superpowers to an admin in order to add different roles, or it’d have to be don manually?
I’m turning this into a feature request, would it be possible to add roles from the app? As the admin of a private app, every time you add a user you have to manually enter the role in the editor, which is quite annoying and the app looses some of its purpose…being an app and not a spreadsheet!!
A role can be an array column…You’d need to create an array column with all possible roles and assign it to your admins.
Yea, however I’d need to add a new column every time…which would be long
How many different roles do you have?
See the thing is that they are not roles as such but company names…so the number can be elevated. There will be users within each company, so for now 6/7, but potentially 100s. Couldn’t give you a number
Ah…ya, not scalable. Another reason why Glide should have the ability to have a special column type that recognizes a singular CSV cell as an arraycolumn (or allow us to select a split text column for roles/row owners). @Mark
Are you able to set a role through a set column action? Just looking for some sort of loophole. Thinking maybe if you still have some control, as the developer, over how the column is set, then maybe it would work???
I’ve tested that and it doesn’t work - even if I have the same role that I’m trying to set. ie. I’m an admin and I’m trying to give somebody else an admin role. So I think it only works when adding a new user (I haven’t actually tested that).
I’m with Pablo on this one, as I have a similar challenge.
One of my apps is essentially an employee database, and I have a bunch of roles (about a dozen) that roughly equate to department/position. I use these roles to determine what various groups of users can do and see within the app.
I want to give my HR (Human Resources) folk the ability to assign roles, but I can’t do this without also giving them every single role - which just doesn’t make sense. And even if I do that, they still wouldn’t be able to assign roles to existing users. And it gets worse, given this.
Ideally what I’d like to be able to do is give a user (or users) a “super-admin” role that gives them the ability to create any user and assign any role, and edit any user and assign any role.
But as things stand right now, the only way (that I can see) to assign roles in that way is to do it manually.
I’m gonna try with an if then else in the spreadsheet as the final temporary solution, I’ve tried what you mention Jeff, with template columns, set columns, and a million a other ways, but it’s a fail every time. So I’ll see if the value displays using an if then else formula in Google sheets
I’ve been toying with the idea of a scripting solution as a workaround. Something like this:
- Expose the list of roles in the UI (both for create and edit users)
- Rather than try to write the role to the User Profiles sheet, write it as a temporary row in another sheet - with the UserID and the Role as columns
- A trigger script picks that up and makes the appropriate change in the User Profile sheet.
This should work okay if the User Profiles are based on a GSheet (as mine are), but if you’re using a Glide Table then it’s back to the drawing board.
Hit me up if it works
Actually, I just re-tested using a Set Columns on an existing user, and it does work. Even for a role that I don’t have!
ie:
- My role is Admin
- I edited an existing user and used a Set Columns to change their role to Admin (works)
- Edited the same user and changed their role to one that I don’t have (works)
- Repeated the same for several different roles (all worked)
I could swear that I tested that yesterday and it didn’t work… maybe Glide snuck in an update while we weren’t watching
Anyway, that appears to be at least half the problem solved for me. @PabloMFalero you said you tested this scenario and it didn’t work for you?
Now test it on the real app and tell me if it works. In the editor it works beautifully, but not in the real app, or at least for me.
And now I’m getting sync issues and I can even tell you if it works with the if-then-else in google sheets. My data is not synchronising with the spreadsheet…
Okay, this is interesting…
I have multiple role columns, so I decided to test to see if I could change more than one using Set Columns.
I set my app up like this:
- Both choice components write to separate user specific columns
- Then on submit, the role columns are updated via a Set Columns action
- “Primary Role” is written to “Role 1”, and “Secondary Role” is written to “Role 2”
Results:
- Via the builder:
- Both columns are updated
- Via the app
- only the Secondary Role (Role 2) is updated
So… it looks like you can use this method to update roles, as long as it’s not the first column in the array
Gonna try now with 3 Role columns and see what happens…
UPDATE
Tested with 3 role columns, and result as expected…
- Via the builder
- All 3 Role columns updated
- Via the app
- Role 1 unchanged, Role 2 & Role 3 updated
So as I will have many many roles, the array way doesn’t work for me. So the way I’ve done it (and it works) use the ite. I have a column, in this case, with the name of the company (which will be the role), and by using the formula in the spreadsheet it creates the role. So the formula that results in the role is =ARRAYFORMULA(IF(E7<>"";E7:E;"")). Column E, in this case, is the name of the company that also results in the Role. So I can say that problem temporarily solved, however, it’d be ideal if we can just add a role without having to add formulas (@Mark , great feature to add to the list, AND YOU CAN DO IT LIVE ON THURSDAY!!! )
Ouu and forgot, make sure you vote so we catch @david’s attention
yeah, it sound like you’re basically using roles as method for multi-tenancy, which is a completely different use case to mine. But we’ve both bumped into the same limitation.
Sorry, I don’t understand what you’re asking for.