Skip to main content

Migrate HRIS Expressions from GoLang (GoTemplate) to EXPR

JumpCloud is transitioning the evaluation engine for Custom REST API Import Human Resource Information System (HRIS) connectors from GoLang (GoTemplate) to EXPR. EXPR is a more expressive, standardized language for attribute transformations, pre-processing filters, and user state management when you import identity records from HRIS providers such as Workday, Personio, UKG Pro, and Dayforce.

Key Reasons for Migration​

  • Enhanced expressiveness - EXPR is a purpose-built expression language with native operators, array manipulations, and string transformation capabilities that were cumbersome or limited in GoTemplates.
  • Pre-processing data filters - Filter incoming provider payloads directly. This helps prevent state misalignment or unintended attribute overwrites when providers return multiple records per person, such as re-hires or multi-assignment profiles.
  • Dynamic attribute and state mappings - Simplify translation logic for custom user attributes, dynamic group rules, and status mapping without hardcoded translation lists.

Admin Migration Workflow​

Administrators receive an in-app notice when they edit an existing HRIS Import configuration that still uses GoTemplate expressions.

To migrate a connector to EXPR​

  1. Go to Identity Management > HR Directories.
  2. Open the Custom REST API Import connector that uses GoTemplate expressions.
  3. Change Legacy Expression to Expression. The Migration modal appears.
  4. Use the JumpCloud Admin AI Assistant, or your preferred AI tool, to convert your legacy Go expressions to EXPR.
  5. Review the converted expressions with Preview Mapping before you save the updated connector.
note

Migrating to EXPR is not mandatory. Existing integrations can continue to use Legacy Expressions as long as you do not change the attribute mappings.

See the official EXPR documentation: EXPR Language Definition.

Writing EXPR Expressions​

The following examples show how to construct an EXPR expression. providerUser. is the standard prefix for accessing any field returned by the HRIS provider.

EXPR Examples​

Input:

{ "id":"123", "preferred_name":"xyz" }

Expression: providerUser.preferred_name

Result: xyz


Input:

{ "id":"123", "preferred_name":"xyz" }

Expression: providerUser.preferred_name + " random string"

Result: xyz random string


Input:

{ "id": "123", "username": "hello.world", "preferred_name":"null" }

Expression: (providerUser.preferred_name ?? "") != "" ? providerUser.preferred_name : providerUser.username

Result: hello.world


Input:

{ "id": "123", "first_name": "Hello", "last_name":"World" }

Expression: providerUser.first_name + " " + providerUser.last_name

Result: Hello World


Input:

{ "id": "123", "first_name": "Hello", "last_name":"World", "department":"Engineering", "is_manager":true }

Expression: providerUser.is_manager == true ? "Engineering Manager" : "Engineer"

Result: Engineering Manager


Input:

{ "id": "123", "first_name": "John", "last_name":"Doe", "employment_type":{ "name":"IT Consultant" } }

Expression: (providerUser.employment_type != nil && providerUser.employment_type.name != nil && providerUser.employment_type.name contains "Consultant" ? "[B2B] " : (providerUser.employment_type != nil && providerUser.employment_type.name != nil && providerUser.employment_type.name contains "Employee" ? "[EMP] " : "")) + (providerUser.first_name ?? "") + " " + (providerUser.last_name ?? "")

Result: [B2B] John Doe


Input:

{ "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: len(providerUser.eligible_paid_time_off ?? []) > 1 ? providerUser.eligible_paid_time_off[1].policy_name : ""

Result: Paid Time Off Policy


Input:

{ "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: len(providerUser.jobs ?? []) > 0 && len(providerUser.jobs[0].compensations ?? []) > 1 ? providerUser.jobs[0].compensations[1].rate : nil

Result: 85000.00


Input:

{ "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: len(filter(providerUser.customFieldGroup.codeFields ?? [], #.itemID == "1500091404_30")) > 0 ? (filter(providerUser.customFieldGroup.codeFields ?? [], #.itemID == "1500091404_30")[0].nameCode?.codeValue ?? "") : ""

Result: Uniform Size

GoLang to EXPR Migration Table​

GoLang Template ExpressionEXPR Expression
{{.preferred_name}}providerUser.preferred_name
{{or .preferred_name .username}}(providerUser.preferred_name ?? "") != "" ? providerUser.preferred_name : (providerUser.username ?? "")
{{.first_name}} {{.last_name}}providerUser.first_name + " " + providerUser.last_name
{{- range .workAssignments -}}{{- if eq .assignmentStatus.statusCode.codeValue "A" -}}{{- if .assignedWorkLocations -}}{{- if (index .assignedWorkLocations 0).address -}}{{- (index .assignedWorkLocations 0).address.lineOne -}}{{- end -}}{{- end -}}{{- end -}}{{- end -}}len(filter(providerUser.workAssignments ?? [], (#.assignmentStatus?.statusCode?.codeValue ?? "") == 'A' && len(#.assignedWorkLocations ?? []) > 0)) > 0 ? (filter(providerUser.workAssignments ?? [], (#.assignmentStatus?.statusCode?.codeValue ?? "") == 'A' && len(#.assignedWorkLocations ?? []) > 0)[0].assignedWorkLocations[0]?.address?.lineOne ?? "") : ""
{{- range .workAssignments -}}{{- if eq .assignmentStatus.statusCode.codeValue "A" -}}{{- if .assignedWorkLocations -}}{{- if (index .assignedWorkLocations 0).address -}}{{- if (index .assignedWorkLocations 0).address.countrySubdivisionLevel1 -}}{{- (index .assignedWorkLocations 0).address.countrySubdivisionLevel1.shortName -}}{{- end -}}{{- end -}}{{- end -}}{{- end -}}{{- end -}}len(filter(providerUser.workAssignments ?? [], (#.assignmentStatus?.statusCode?.codeValue ?? "") == "A")) > 0 && len(filter(providerUser.workAssignments ?? [], (#.assignmentStatus?.statusCode?.codeValue ?? "") == "A")[0].assignedWorkLocations ?? []) > 0 ? (filter(providerUser.workAssignments ?? [], (#.assignmentStatus?.statusCode?.codeValue ?? "") == "A")[0].assignedWorkLocations[0].address?.countrySubdivisionLevel1?.shortName ?? "") : ""
{{ if or (and (.user.active) (eq .status "ACTIVE" "ACCEPTED")) (and (not .user.active) (eq .status "TERMINATED" "INIT" "HIRED")) }}{{ or .user.name.preferred_given_name .user.name.given_name }}{{ end }}`((providerUser.user?.active == true && providerUser.status in ["ACTIVE", "ACCEPTED"])

Learn More

Was this information helpful?