Add a button on a screen

Hi all,

I have added some brand new button on a brand new screen. When I apply the button action it ONLY affects the admin user!

How can I affect a user instead of the admin?

Thanks

p.s. This brand new button checks some boolean value in some table

It’s unclear what user experience you are building, maybe you could share more in detail.

Without knowing the details, I would suggest you use action components (such as a button) in a collection (collections are a component type in the Layout Editor) or on details screen (the screen you can navigate to after clicking on a collection item).

Not sure I understand you!

It’s a simple portal application with a single button and two types of user: admin and a user. Created a button. That button only affects the admin and NOT the user.

Summary: set a visibility condition on the button or condition on the action by pointing to a column in the Users table.


When you select the button component, on the right you can configure it. Head to the second tab called “Options”, and there you can set a visibility condition which you set by pointing to the Users table and column where you set the roles.

Alternatively, the button triggers an action. You can also set conditions at the action level when you choose the action in the Layout Editor. Same as above, you would set the conditions a column in the Users table.

1 Like

The problem I am having has to do with this item vs user profile>user profile row

This item boolean is good enough, but the check is for user profile (visibility)

How can I reconcile the two?

If you’re wanting to make a button that is only visible to admins, make sure you have a boolean column in the Users table (Call it “Admin?” or something), and you simply check the boolean for users you want to make admin. This item is for the item you’re looking at. If the button’s on a detail screen, it will be for the item that detail screen is for. If it’s inside a collection, it will be for that item you click the button from. You should use User Profile > User Profile Row all the time, that is always gonna be for the row of the signed in user in the Users table. So just set your button’s visiblity condition to User Profile > User Profile Row > Admin? is checked.

Forget about the button for a sec.

There is a boolean column that exists for all users, including admin.

if I happen to set the boolean using this item then the variable is only set for the admin user.

if that boolean variable is set for user profile>user profile row then it is set for a particular user.

if I happen to have a long (and dynamic) list of users, how can I set and later check for that same boolean?

I can only refer you to my most recent post. (visibility check is only a particular user)

Thank you for your answer

What I am trying to achieve is hide all normal users on some screen (I rely on Visibility) once the admin sets a boolean value from a different screen?

(Visibilty is per user)

How can that be accomplished?

Thanks a bunch

I wish there was a way to create a single field

(that is shared between all users)

On the detail screen of a specific user, if you set the boolean from there, then it will apply for that user

True.

what about ALL users?

I would like to set a variable, and to have variable be applied to ALL users of the system?

Sorry I’m not too sure right now.

  • Create a helper table, name it Settings or something like that.
  • Add a field in that table that you want to write the value to.
  • Cast that field to all rows in the Users table, by a single value column.
1 Like

Thank you. Thank you. Can you please explain what it means to cast?

You use a Single Value > first in your Users table and point it to the “helper” table above. “Cast” means getting that value to show up in all rows.

I am sorry, cast using Single value? Using what? How is casting done?

Glide have several computed columns, one of them is Single Value column, use it.

But I don’t have write access to those computed columns. Those computed fields do not appear on user profile (users table)

If you need to access to write to single row table from user table, so one of the way is use silgle value whole row and use it in set column action or open edit screen using Single value from whole row

Just use edit screen instead details screen

Fair enough, kudos. Now, how can one do something upon loading a screen?