Skip to main content
Nintex Community Menu Bar
Question

Conditional Rendering on row action button based on combination of model field value and running use

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

Forum|alt.badge.img+5

I need to conditionally render a table row action button based on a combination of the running user attribute and a field value in the model.

For example, I have a user with a Role of “A”. I also have a model field value which I can make the same as the Role, “A”.

Can I conditionally render a row action button if the running user’s attribute equals A and the row in the table has a model field equal to A? 


Did this topic help you find an answer to your question?

4 replies

Forum|alt.badge.img+18

Ben,

Are you asking for one condition: fieldValue = userRole,

Or are you asking for two conditions:

fieldValue = X
userRole = Y

?


If the first, just set your condition so that the field value equals the user role with merge syntax {{$User.userRoleId}} (if you need the actual user Role Name, you’d just need to create a model for the current user, and reference it like so: {{$Model.CurrentUser.data.0.Role.Name}})

If the latter, just add both as rendering conditions and require ALL conditions to be met.

Translate

Forum|alt.badge.img+5
  • Author
  • 38 replies
  • July 10, 2024

Hey Matt,

Thanks for the response. The second option is what I’m looking for - two conditions - fieldValue = x and userRole = Y. 

“If the latter, just add both as rendering conditions and require ALL conditions to be met.” - that makes sense. However, I just realized a snag in my plan. The userRoile will not be the same value as the model field. It looks like I can’t create a custom field on the user record and use that for rendering conditions. 

Any ideas? I’m completely stuck here. Thanks for any help or feedback.

Translate

Forum|alt.badge.img+18

Ben,

Why can’t you create a custom field on the user object?

If you can provide a more complete description of your use case, we can probably help you find a way.

Translate

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

Why can you not create a custom object on the user record?  is there some “edition limitation” here? 
The custom field will not show up in the list of user attributes always available for conditions,  but you can always get around that if you create a “current user model”  and include the custom field in your model.  Then you can do conditional rendering on that model / field combination in addition to your actual fieldValue. 

Translate

Reply


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