Set Condition and/or Render Based On User Alias

  • 1
  • Question
  • Updated 1 year ago
  • Answered
  • (Edited)
Does the ability to set conditions and/or render based on the alias someone is assigned within their user profile.  For example, if an individuals alias is DG, could this be set as a condition or render condition.

I did not see this ability in the rendering options, but I was thinking there may be a way to do this by setting and activating a condition where the value is the user alias.

Photo of David Garrity

David Garrity

  • 856 Points 500 badge 2x thumb

Posted 1 year ago

  • 1
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
This is an option if you were to include the field in one of your models.
Photo of David Garrity

David Garrity

  • 856 Points 500 badge 2x thumb
That is what I was thinking to do is add the field to the model.  However, I was not sure what the value to link to the user's alias would be {{$user.alias}}?
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
I'd have to see the page to better understand. Can you posted the XML here?
Photo of David Garrity

David Garrity

  • 856 Points 500 badge 2x thumb
The page has not been built out yet, as I was just trying to see if the functionality is even feasible.  Basically, there would be a field called "Unit".  Users would be assigned within their alias a Unit, say 43B.  As records are entered and created, the required unit field would be populated.

The hope was that I would be able to make a condition to filter the unit based on the one in the individuals profile using conditions.
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
You would probably select "running user attribute" as the Content Type instead of Single Specified Value and then select the alias attribute. It will pull the current users  alias out for you.
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
I'm certain it is possible.
Photo of David Garrity

David Garrity

  • 856 Points 500 badge 2x thumb
I guess that gets to the heart of my question, when choosing a running user attribute, I do not see one that is associated with the alias of the user (attached is the list I receive).
(Edited)
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
Ah... then you will need an extra step. Create a model Named UserAlias on the user object. Set a condition on the model so that it is limited to userId equal to the running user's userId. Then add the fields Id and alias. Then you will be able to use that field for conditions and rendering and {{$Model.UserAlias.data.0.Alias}} as merge variable.
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Et voila!