Skip to main content
Nintex Community Menu Bar
Question

How to Use Profle/Role Name in a Rendering Condition using the Running User Attributes

  • July 9, 2024
  • 10 replies
  • 0 views
  • Translate

Forum|alt.badge.img+8

I have not been able to get this to work and am hoping there is a simple solution to this that I am missing. I am trying to show certain components (fields, tabs etc…) based on the running users Profile/Role Name. I tried the below and it is not working. I need to use name because of ID differences between environments. I don’t really want to have a entire page copy for a different profile as I only have a couple pieces that need to render based on User Role.

How can I achieve this?

6c9fa023f5b5e3092fe51d2267ca120330dd6500.png

Did this topic help you find an answer to your question?
This topic has been closed for comments

10 replies

Forum|alt.badge.img+8

I tried adding a formula field to the User object to get the Role > Name. But the field is not available for use in the Rendering statement list for Running User Attributes.

Translate

Forum|alt.badge.img+9

It’s probably not working because Role Id is a Salesforce Id and not text. I always make a model called RunningUser on the user object like so, and use it for rendering stuff :

c07199abbad413d03cfd5a1fbe4d31a6d4222267.jpg

Translate

Forum|alt.badge.img+8

Ah ok, I was kind of thinking it had the model there already since the conditions allow to use that small set of user properties. Makes sense though to just go get the entire user model.

Translate

Forum|alt.badge.img+13

When you say “Id differences between environments”, are you building a managed package, or just dealing with moving between Sandboxes tied to one Production org? If the latter, then the Ids for Profiles, Users, and Roles don’t change between Sandboxes / Production as long as they’re Sandboxes of the same Production org — the Ids are consistent.

However, if you’re building a managed package, OR if you just don’t want to deal with Ids and would rather deal with Names, then Moshe’s approach is the recommended one:

1. Create Formula Field(s) on the User object called “Profile Name” or “User Role Name”, whose formula values are “Profile.Name” and “UserRole.Name”, as needed. These are necessary because for some reason, standard users do not have access to the Profile.Name field (even for their own Profile!) directly via a Model on the User object — very annoying. But Formula Fields circumvent this limitation — any user will be able to see the Name of their Profile or Role if you create a Formula Field for this purpose.
2. Create a Model on the User object called “RunningUser” or something like that, with a Condition on it limiting the Model to return just the user record for the running user. Request your custom “Profile Name” and/or “User Role Name” formula fields.
3. IN your Rendering Conditions, have the Source Type be “Model field value” rather than Running user attribute, and point it at the RunningUser Model, and at the User Role Name or Profile Name fields.

Translate

Forum|alt.badge.img+4
  • Nintex Employee
  • 27 replies
  • July 9, 2024

Zach, I just followed your instructions and still can’t get this to work. It is something I actually gave up on awhile ago and am coming back to…

I am testing it out on a button, but need to use the solution in about a million other places.

Am I missing something?

Translate

Forum|alt.badge.img+17
  • Nintex Employee
  • 3763 replies
  • July 9, 2024

Sarah.  Can you maybe send us an email (support at skuidify dot com) with a more detailed description of what you are trying to do and what is happening with it?

We want to take care of you…  

Translate

Forum|alt.badge.img+4
  • Nintex Employee
  • 27 replies
  • July 9, 2024

Will do.

Translate

Forum|alt.badge.img+1

Hi Moshe,

        My Scenario :
        I want to display the  list of all the users from specific Profile For Example (Sales Profile)
        
        Problem :
        It is works fine with  System Administrator profile but it does not work for Sales Profile 



Thanks In Advance !!

Translate

Forum|alt.badge.img+17
  • Nintex Employee
  • 3763 replies
  • July 9, 2024

Most likely that profile does not have access to the profile object.  Do they have the “view setup and configuration” system permission? 

Translate

Forum|alt.badge.img+1

Hi Rob.

I have enable " view setup and configuration" system permission for Sales user and my filter condition works as expected.

It also enable set up option as well.

Is there any way to remove set up option for sales profile

Translate

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings