User expressions
User fields point back to a particular user in your system. Data about that user is pulled from the user management table.
Fields
Any user field that you created on your form can be a part of an expression.
You can also take advantage of these system user fields:
System field |
Description |
_created_by |
The user who started the item |
_modified_by |
The last user who modified the form |
This expression also results in a user field:
lastcompletedstep().approvers()
Displaying user information in forms
User fields cannot display on their own. You must use the dot operator and then add the specific field you want to display. Fields must match with the user management table. For example:
_created_by.FirstName
Here is a list of default fields you can call up from the user management table:
Field name |
Data type |
Sample syntax |
Output |
Example |
FirstName |
Text |
_created_by.FirstName |
Creator’s first name |
Pepper |
LastName |
Text |
_created_by.LastName |
Creator’s last name |
Potts |
Name |
Text |
_created_by.Name |
Creator’s full name |
Pepper Potts |
Text |
_created_by.Email |
Creator’s email address |
||
UserType |
Text |
_created_by.UserType |
Creator’s user type |
Super Admin |
Added on |
Datetime |
_created_by._created_at |
Date and time the creator was added to the account |
2019-05-23 11:49 AM |
Last signed in |
Datetime |
_created_by.LastLoggedInAt |
Date and time the creator last logged into Kissflow |
2019-10-31 11:52 AM |
Manager |
User1 |
_created_by.Manager |
Creator's manager |
|
1. If you want to display information about the Manager in a text field, you must use the dot operator to add an additional field. For example:
_created_by.Manager.Name
Assigning steps with user expressions
In the workflow, you can use a formula to assign a step to a user. In this expression, the data type must be a User.
You can use:
- the Field ID of any user field in your form
- a system field
- a user field called up from the user management table (such as Manager)
(or)
You can also use the following user functions as per your requirements:
User function
Note:
Input: Email address
Syntax: user(<email_address>)
This function returns the user information based on the given email address.
If the email address is elizamendis@starkcorp.com, this function will return the user information mapped with this email address. You can also fetch the other attributes of the user by using a dot operator accordingly.
Userandgroup function
Note:
Input: Email address or Group name
Syntax: userandgroup(<email_address> | "<group_name>")
This returns the user information based on the email address or the group name passed in the function.
If the email address is elizamendis@starkcorp.com, this function will return the user information mapped with this email address. If the group name passed is “Finance team”, this function will return the relevant group with the mentioned name.
Userandgrouplist function
Note:
Input: List of email addresses or group names
Syntax: userandgrouplist([<email_address01>,<email_address02>,<email_address03>] | ["<group_name01>","<group_name02>","<group_name03>"])
This function returns a list of user objects or groups based on the input given.
For example:
userandgrouplist(“tonystark@starkcorp.com”, “jacobs@starkcorp.com”, and “elizamendis@starkcorp.com”) will set ‘Tony Stark’, ‘Jacob’, and ‘Eliza Mendis’ as the assignees for the step accordingly.
userandgrouplist(“Finance”, “HR”, “New recruits”) will assign the step to the Finance team, HR team, and the New Recruits batch in one go.
Tip:
You can also use the IF function to assign a step, but both results must be user fields.
Using comparison operators with user fields
The equal to (=) and not equal to (<>) operators can work with user fields.
Here's a common use case. You have a step in a workflow called Manager approval and it is assigned to the creator's manager. But what if the manager is the creator?
Create a condition for that step with this expression:
_created_by<>_created_by.Manager
Employee function
You can use a default field or a custom field of a specific employee from the Employee management table in your form using the Employee function. The primary purpose of this function is to fetch the custom fields created as part of the Employee management flow alongside the default fields in your Kissflow account.
The fields you create using the () in the Employee management table are the custom fields. Let us assume the field "Blood Group" is one such custom field created to store the blood group information of your employees in your organization. The following is the formula to derive the Blood Group of a specific employee:
Note:
Syntax: _employee(<system_field>).<Field ID of the custom field>
Example: _employee(_created_by).Blood_Group
"Blood_Group" is the field ID of the custom field "Blood Group". You can either type the above formula directly in the Formula bar of the field settings or choose the Employee function and Blood Group field directly from the formula dropdown. Please refer to the screen recording below for your understanding:
Likewise, you can also get the default attributes of a system field using this function.
Note:
Syntax: _employee(<system_field>).<default_field_name>
Example: _employee(_created_by).Name
In the above example, _employee() is the name of the function and (_created_by).Name is the syntax to fetch the name of the employee who started the item.
"_created_by" is a system field that contains the information of the user who initiated the item. You have to use a dot operator to derive the default attributes of this user like First name, Email, Department, etc. Learn how to use the dot operator on a system field here.
Refer to the following table to learn about the list of fields that you can fetch from the Employee management table using this function:
Field name |
Data type |
Sample syntax |
Output |
Example |
First name |
Text |
_employee(_created_by).FirstName |
Creator’s first name |
Virginia |
Last name |
Text |
_employee(_created_by).LastName |
Creator’s last name |
Potts |
Name |
Text |
_employee(_created_by).Name |
Creator’s full name |
Virginia Potts |
Nickname |
Text |
_employee(_created_by).NickName |
Creator’s nickname |
Pepper |
Department |
Text |
_employee(_created_by)._department |
Creator’s department |
Admin |
Email Address |
Text |
_employee(_created_by)._Email |
Creator’s Email address |
|
Phone number |
Text |
_employee(_created_by)._Phone |
Creator’s phone number |
555-123-4567 |
User type |
Text |
_employee(_created_by).UserType |
Creator’s user type |
Super Admin |
Status |
Text |
_employee(_created_by).Status |
Creator’s account status |
Active |
Job title |
Text |
_employee(_created_by).Designation |
Creator’s designation |
Personal Assistant |
Added by |
User1 |
_employee(_created_by)._created_by |
User who added the creator to the account |
Tony Stark |
Added on |
Datetime |
_employee(_created_by)._created_at |
Date and time the creator was added to the account |
2019-05-23 11:49 AM |
About me |
Text |
_employee(_created_by).AboutMe |
Creator’s "About me" section information |
I manage everything about Stark Industries |
Tip:
Please note that the Employee function does not list the fields that have been restricted as part of the Employee management flow's security settings. i.e. If a field is marked 'Protected' in the Employee management table, it cannot be called or used in the process form using this function.