Accessing logged in user info directly, without a control

I am trying to access the usergroup of the logged in user so that I can dynamically update what is shown on the screen for that user.

The way that I did this is to create a text control that looks up the usergroup for the logged in user. Then I can use the text control to dynamically change the data on the screen. The only way I could figure out how to access user data was from a control.

But when I duplicate the screen, this “usergroup text control” creates copies of itself with the appendix 1, 2, 3, 4, etc. So there are a ton of unique copies of this text control.

I’m not sure how to either:

  1. Have a persistent header which I can use on multiple screens, or
  2. Access info from the logged in user directly in a formula.

The way that I have it now is very messy and has already broken a few times. Maybe variables is a way that it could be done? But when I try to set a variable, it can only be set to a control, so we are back to where we started.

Hi Marc,

When you duplicate a screen, the system by default will duplicate all its controls (with its UI & properties) to the newly created screen.

The controls copied to this new screen will have the same control Label (a control’s property) as that of the main screen which you have duplicated or copy-pasted here. But for the system to uniquely identify these controls, there will always be a different Unique Name (another control property). So in case of copied or duplicated screen/controls, the system automatically takes the same Label of the control from the main screen followed by an incremental index number.

Unique Name is used to uniquely identify a control in your App. Every control that is added to the screen gets an auto-generated Unique Name based on the Label name given to the control.

Understand it in this way, if you have 3 controls with the same name, and want to use their respective reference in other 3 different controls, how will the system identify which control you are referring to. For this, we use the Unique Name property. For instance, you have 1 text input control named (Label property) “Sample”. Now you have either

  1. copy-pasted/duplicated this control on the same/another screen

  2. copy-pasted/duplicated the screen where you have added this text input control named Sample

  3. drag and dropped another text input control and used the same name (Label) “Sample”

In this case, while the Label remains the same (Sample) for both text input controls, their Unique Name will be different, Sample, Sample1. In other words, the Label (or control header/name) remains persistent until you manually change it.

  • If you don’t want to replicate the control while duplicating a screen and this control will never be used for display purposes, you can use the variables instead. You can know more about variables here.

  • You can also get user groups of the loggedin user directly in a control’s formula via its Data section > Loggedin User.

  • Or you can manually delete this “usergroup text control” for the other (duplicated) screens and take reference of usergroup text control wherever required from the main screen only.

You can go with any of the options that suit best for your use case. :slightly_smiling_face:

Ok, thanks prerna. I’ll check out if I can use variables.

So I’m testing out sending data to a screen.

I don’t want to have every field use a separate connector query because each one of those counts as an action, correct?

So first I tried to use a detailview control and pull in the data from a connector to that. But I cannot link a control to a detailview.

Second, I tried to use a hidden tablegrid control and pull a single row of data into that. But I cannot connect a control to that tablegrid unless the user also selects the returned row.

Is there a way to automatically have the returned row selected? Like “select first row” command or something?

I am also trying to directly bind each control to a connector, but I am getting lots of “unable to get data from backend” errors. When I use the same connector in the detailview it works fine, so I’m not clear on the error. I’m trying dropdown controls .

I found the “select row” option! It’s right in the tablegrid settings, toward the bottom.
“Default Selected Row”.
Ok, I think I can get this to work.

Also, it “feels like” I often have to refresh the app to get the action/logic changes to update in the Preview.

So there have been a few times in the past where I swore I had things right but it wasn’t working, and then when I came back later, it worked.

So for example, I just create an editor screen that only uses a variable to display data, and then had a table screen set that variable and navigated to the editor.

I duplicated the table screen, so it should be exactly the same in every way, but the duplicated screen, when I click on a row and navigate to the editor screen, the editor screen does not pull the data.

So like, something is wrong here, and I don’t think it is me… but I can’t tell.


If you are using “Navigate To” action for your “row_select” Event, can you check and confirm if Reset Target Screen is set to TRUE?

If its Set to FALSE, then all its control will not get re-evaluated if opening the same screen second time.

Hope this Helps!