Skip to main content

FieldLogs

Identity

The Identity category includes two types of Script Instructions.

  1. Flkw:GetValueInIdentity

  2. Flkw:UserHasRole

To know more about Identities, see Enterprise Identities.

Flkw:GetValueInIdentity retrieves the value of the selected Property of the selected Identity in the current user profile and stores it in a Local Variable.

Format:Flkw:GetValueInIdentity('Identity name', 'Property name');

Parameter

Description

Identity name

The title of the Identity defined in the account settings.

Property name

The name of the property from which you want to get the value.

To construct a Script Instruction using Flkw:GetValueInIdentity:

  • Select JS Execute from the Instruction dropdown list. In the Expression field, enter the Flkw:GetValueInIdentity Instruction as shown.

    Identity1.png

The Flkw:GetValueInIdentity Instruction is added to the Script.

Flkw:UserHasRole 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 who is currently logged in belongs to a certain project or not.

Format:Flkw:UserHasRole('Role name');

Parameter

Description

role name

The name of the role that you want to check.

To construct a Script Instruction using Flkw:UserHasRole:

  • Select JS Execute from the Instruction dropdown list. In the Expression field, enter the Flkw:UserHasRole Instruction as shown.

    UserHasRole1.png

The Flkw:UserHasRole Instruction is added to the Script.

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

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.

The Script displays the following message.

UserHasRole3.png