Skip to main content

FieldLogs

Identity

The Identity category includes two types of Script Instructions.

  1. Get Value of an Identity Property

  2. User has Role

To know more about Identities, see Enterprise Identities.

Get Value of an Identity Property

Get Value of an Identity Property is an Identity Instruction that retrieves the value of the selected Property of the selected Identity in the current user profile and stores it in a Local Variable.

To construct a Script Instruction using Get Value of an Identity Property:

  1. Select Get Value of an Identity from the Instruction dropdown list. Options Variable Name, Identity Name and Expression appear as seen below.

    GetValueofAnIdentity1.png
  2. Enter the name of a Local Variable in the Variable Name field. Enter the identity defined in the current user profile in the Identity Name field. In the Expression field, enter a JavaScript Expression that specifies the Property (of the entered Identity) that needs to be retrieved.

    The Get Value of an Identity Property Script Instruction is added to the Script.

User has Role

User has Role is an Identity Instruction that checks if the current user has a certain Role or not. For example, it can be used to check if the user belongs to an organization or not.

To construct a Script Instruction using User has Role Property:

  1. Select User has Role from the Instruction dropdown list. Options Variable Name and Role appear as seen below.

    UserHasRole1.png
  2. Enter the name of a Local Variable that holds the result in the Variable Name field. Select the Role to be checked in the Role dropdown list.

    In the below example:

    At runtime, this Script Instruction checks if the user has the Role 'Admin'.

    If the user has the Role Admin, a Boolean value TRUE is stored in the variable isAdmin.

    If the user does not have the Role Admin, a Boolean value FALSE is stored in the variable isAdmin.

    UserHasRole2.png

    The User has Role Script Instruction is added to the Script.

    UserhasRole3.png