When I select or enter data for my users (stored in Glide tables), the data either reverts back to its old value (from “A” to “a” in the case of my own row, for example) or get deleted from the cell entirely within a few minutes.
Expected behavior:
Data should sync between the app & Glide tables
How to replicate:
Create an app with a Users Glide table. Edit a value in one of the columns of one of the rows (a Users table, for example) & assign data to a variable/cell. Wait about 5 minutes. See if the data is still in the cell.
[Updated to reduce confusion - Type of data isn’t really the issue.]
I’m sorry - I’m not following. How does an Admin change the role of a user with lesser access?
And regardless, I guess my question is also regarding the disappearance of edits made directly in the Glide table in the development environment as an admin.
It seems there are app/Glide table sync delays &/or errors of some kind happening in the background. No Internet connection issues, & the change does appear successful for a few minutes before reverting.
So if we had to assume such glitches are inevitable (& not bugs by strict definition), I guess the “how to” question is… How does one reduce the chances of these sync glitches/errors happening?
There is no such concept of user priviledges that you are thinking of… your glide app does not know whether an “admin” or “master” has more or less control than each other.
The dissapearance you are seeing is because… validation is being done after you submit… that realises you didn’t have the right to set a role to the user… because of the fact that the user you are using does not have the same “role”.
You can get around this by using a new column and setting your role there and then programming your app as needed.
You can’t use the existing role as you are trying to do (allowing different roles to be set). So you can create a new “role” column (but suggest you call it something else) and then change the logic to use this new column… the result will be the same for your app… but you wont have problems setting the new role as you wish. I would probably make sure that the user setting the role is allowed to though.
The only real reason to use User Profile Roles is if you want to use the named roles as Row Owners - either in the same table or other tables. This is a way to restrict which rows of data will be available on each users device, and it allows you to group users together so that they have access to the same set of data rows. For example, consider a business hierarchy where a CEO should have access to all users data, and functional managers should have access to the data of only their direct reports. Roles as Row Owners is a good way to secure data in this scenario. Have a read of the below for a more detailed explanation:
When using User Profile Roles, there are general rules about when a role can be set:
when a user is created, the role can only be set if the creator has the same role as the one they are attempting to set
when a user record is being edited, the role value cannot be changed under any circumstances.
in both of the above cases, you might see the change made initially, but as soon as the builder syncs with the Glide back end the change will be reverted (which explains your experience).
There are two workarounds to each of the above:
manually edit/set the role via the data editor
use the Glide API
However, if your goal is to just to use “roles” to control tab/screen/component visibility, then it is not necessary to use User Profile Roles. Instead you can use what I like to refer to as pseudo roles. In this scenario you can have a Role column in your User Profiles table, but you don’t set it as such in your User Profiles Configuration. When using pseudo roles, there are no restrictions on setting/changing values. As long as the user making the change has access to the row, they can set the value.
I have renamed the “Role” column “Pseudo Role” & added a “Role” column as a placeholder in case applicable at some point in the development process. Is this enough, or should I have deleted the original “Role” column & redone all my applicable programming?
Do you posses the same Role that you are assigning to your user? If not, then you can’t change it through the app, regardless if you have an “Admin” title or not. At most you may be able to assign the role of “Admin” to another user simply because you also possess that same role.
As has been mentioned a few times now, a user cannot change the native Role if they do not possess the same role themselves. Role functionality is a security feature, so it’s not as simple as changing a value. It’s locked down and can only be changed via the data editor, through an external process, or I believe if the user making the change possesses the exact same role they are changing it to.
You need to check your user profile configuration. If you enabled the use of Roles and assigned Roles functionality to a column in your user table, then that column will have further restrictions (mainly the inability to change it’s value via the app). Renaming a column isn’t going to change it’s function. You need to disconnect it through the user profile configuration if you don’t want to use native Role functionality, and instead want to use a Pseudo Role functionality with simple filters and visibility controls.