When provisioning user accounts from JumpCloud to your SaaS applications or to JumpCloud from an external directory integration, like an HR integration, use expressions to transform user data into your preferred format or to ensure you are getting the needed information.
What are Expressions?
Expressions are rules or formulas used to manipulate and transform user data during the provisioning process. They allow you to dynamically create or modify user attributes, such as usernames, email addresses, etc., based on specific conditions or logic.
Why use Expressions?
Expressions allow you to build in logic for a particular attribute set, like setting a preferred name instead of a legal first name as the first name attribute for specific users.
Benefits
- Improved efficiency - automates data manipulation and formatting tasks, streamlining user provisioning and management
- Flexibility and customization - allows tailoring of data, so the right information is being sent.
Configuring Expressions
To add an Expression
- Log in to the JumpCloud Admin Portal.
- Go to USER AUTHENTICATION > SSO Applications
- Select your application from the Configured Applications list and select the Identity Management tab.
- Go to the User Schema Attribute Mapping section.
- Add or select the user attribute to which you would like to create an expression.
- Click the attribute's ellipsis and then click Add Expression.
- In the Add Expression window, enter your desired expression in the Enter Expression field.
- Click Save.
- If you would like to preview the new mappings, select Preview Mappings.
- After receiving the desired results, click update and then click Save at the bottom of the page.
To edit an Expression
- Click the ellipsis next to the user attribute to which you would like to edit the expression.
- Click Edit Expression and enter the updated expression for the user attribute.
- Click Save in the Edit Expression window.
- If you you like to preview the new mappings, select Preview Mappings.
- If you are receiving the desired results, click update and then click Save at the bottom of the page.
If you click Delete from the attribute's ellipsis, it will delete the entire user attribute, not just the expression.
Using the User Schema Preview
- At the bottom of the attribute mappings, select the Preview Mappings link.
- The User Schema Preview window will show the translation for the first user.
- If you would like to see a preview of a different user, add a filter that will result in that user.
Check your SP's documentation to verify that filters are supported.
You can drag the bottom right corner of each section to see the entire schema.
- Click Update Preview.
- If the preview is returning the desired result, click Close.
- Click update and then click Save at the bottom of the page.
Examples of Expressions
{
"id": "123",
"preferred_name": "xyz"
}
Expression: {{.preferred_name}}
Result: xyz
{
"id": "123",
"username": "hello.world",
"preferred_name": ""
}
Expression: {{or .preferred_name .username}}
Result: hello.world
{
"id": "123",
"first_name": "Hello",
"last_name": "World"
}
Expression: {{.first_name}} {{.last_name}}
Result: Hello World
{
"id": "123",
"first_name": "Hello",
"last_name": "World",
"department": "Engineering",
"is_manager": true
}
Expression: {{if .is_manager}}Engineering Manager{{else}}Engineer{{end}}
Result: Engineering Manager
{
"id": "123",
"eligible_paid_time_off": [
{
"policy_name": "Sick Policy",
"policy_uuid": "1b34bba6-ed31-4bfa-84a4-e70edae0d97d"
},
{
"policy_name": "Paid Time Off Policy",
"policy_uuid": "08fb23bc-88fb-484f-b805-aa7f22399575"
}
]
}
Expression: {{(index .eligible_paid_time_off 1).policy_name}}
Result: Paid Time Off Policy
Expression: {{(index .eligible_paid_time_off 0).policy_name}}
Result: Sick Policy
{
"id": "123",
"jobs": [
{
"compensations": [
{
"job_uuid": "53bee1b5-f7bc-4598-a5e1-66207cc73c4f",
"payment_unit": "Year",
"rate": "78000.00"
},
{
"job_uuid": "53bee1b5-f7bc-4598-a5e1-66207cc73c4f",
"payment_unit": "Year",
"rate": "85000.00"
}
]
}
]
}
Expression: {{(index (index .jobs 0).compensations 1).rate}}
Result: 85000.00
{
"id": "123",
"phone": "12345",
"mobile": "67890"
}
Expression: {{eq .phone .mobile}}
Result: false
"customFieldGroup": {
"codeFields": [
{
"itemID": "13916651_182",
"nameCode": {
"codeValue": "T-Shirt Size",
"shortName": "T-Shirt Size"
}
},
{
"itemID": "1500091404_30",
"nameCode": {
"codeValue": "Uniform Size",
"shortName": "Uniform Size"
}
}
]
}
Expression: {{range .customFieldGroup.codeFields}}{{if (eq .itemID "1500091404_30")}}{{ .nameCode.codeValue }}{{end}}{{end}}
Result: Uniform Size