IAM Core

Create Sync Rules

On this page

It is now time to create sync rules. For HR, we will do this in this order: Org Unit, Person, Employment. We will then create the Entra sync rules.

Steps

Sync rule for Org Unit

Start by going to Identity Hub, select your HR connector and select Sync Rules. Select Org Unit and click +New rule.

In the New rule window, accept the proposed values and click Start Draft.

New rule

Click +Add Mapping and add the rules as defined in the table below. Details for the non-obvious flows will follow below.

SourceTarget
EXTID ExternalIDanchor1
NamedisplayName
REF Parentparent
CONST OrgUnittype

When you select parent, you will get the warning Incompatible types. Click the ƒ Add button. This will show the expression builder. The expression builder has already suggested that we need a follow reference function. In our case, the parent reference is the external ID attribute, so we do not need to enter anything in the referenced attribute. Enter orgUnit in Object type. An empty value in this field would not resolve the reference, so make a habit of always adding the object type.

While we are here, we will show how to test the function to see if it works. At the top, in the box Test against, select Information Technology and see the result. The guid is the same as the parent (Corporate).

Preview org unit

Click Apply to save the expression.

Save expression with org unit

To create a constant flow, select the target attribute type and click ƒ Add. In Expression Type, change to Constant and enter the value OrgUnit. Click Apply to save.

Constant flow

After you have created all flows, click Review and create to save. Look att the result and confirm with Create Rule. The rule has been created but is still inactive and can only join. Click Rule settings and change Enabled and Provisioning to enabled.

Enable sync rule and provisioning

To see the result, at the very top of the screen click the symbol that looks like a clock (Jobs) and select Run full synchronization. After synchronization has completed, navigate to Identity Explorer, Objects, and Org unit. You should see the organization tree.

See the result for org unit

Sync rule for Person

Using similar steps as for Org Unit, create attribute flows as defined in the table below.

SourceTarget
EXTID ExternalIDanchor1
ninanchor2
names/firstnamefirstName
names/lastnamelastName
businessRolecustom/businessRole
CONST HRsource
JOIN names/firstname + " " + names/lastnamedisplayName

To create the attribute flow for businessRole, see custom attributes.

For displayName, create an attribute flow where you use the Join / Concatenate function.

Sync rule for displayname with concatenate

Save the Sync Rule, enable the sync rule and provisioning. Run a full sync. Use Identity Explorer to verify all users have been provisioned as expected.

Sync rule for Employment

For the employment object, we need to create the following rules. For reference attributes, remember to provide the object type (person for identity and manager, orgUnit for orgUnit).

SourceTarget
EXTID ExternalIdanchor1
REF Ref(person)identity
REF Ref(department)orgUnit
CONST employeetype
JOIN see belowdisplayName
personemployeeID
locationofficeLocation
REF Ref(manager)manager

For the displayName attribute, we will use the ability to paste an expression into the editor. Open the expression builder, click JSON and paste the below into the window. Click Apply and look at the result in the Editor.

JSON
{
  "$type": "join",
  "inputs": [
    {
      "$type": "trim",
      "input": {
        "$type": "join",
        "inputs": [
          {
            "$type": "trim",
            "input": {
              "$type": "followreferenceforstring",
              "referencingattribute": "person",
              "referredattribute": "id",
              "subrule": {
                "$type": "join",
                "inputs": [
                  {
                    "$type": "trim",
                    "input": {
                      "$type": "attribute",
                      "attribute": "names/firstname"
                    }
                  },
                  {
                    "$type": "constant",
                    "value": " "
                  },
                  {
                    "$type": "trim",
                    "input": {
                      "$type": "attribute",
                      "attribute": "names/lastname"
                    }
                  }
                ]
              }
            }
          },
          {
            "$type": "constant",
            "value": " - "
          },
          {
            "$type": "trim",
            "input": {
              "$type": "followreferenceforstring",
              "referencingattribute": "department",
              "referredattribute": "id",
              "subrule": {
                "$type": "trim",
                "input": {
                  "$type": "attribute",
                  "attribute": "name"
                }
              }
            }
          }
        ]
      }
    }
  ]
}

If you save and look at it using a preview, it would look like this:

Sync rule with JSON pasted

As you can see, we are following both the references to the person object and the orgUnit object to find values to populate this relationship object.

Save the sync rule, enable it and enable provisioning. Run a fulll sync.

Review the result on an object for all data from HR

In Identity Explorer, find one user and look at all properties.

User in identity explorer

Sync Rule for Entra

This should be quite simple. Select the Entra connector and add a sync rule. The main difference is that we will not enable provisioning. Entra is only allowed to join to existing objects. Note that we want to join on employeeID, so we will remove the default join attribute flow from ExternalID -> anchor1.

SourceTarget
employeeIDanchor1 - Join
identraObjectID
userPrincipalNameentraUserPrincipalName
mailemail
onPremisesSyncEnabledentraOnPremisesSyncEnabled
onPremisesSamAccountNameentraOnPremisesSamAccountName
onPremisesDistinguishedNameentraOnPremisesDistinguisedName

Don't forget to enable the sync rule (but do not turn on provisioning) and run a full sync.

Go back to your user in identity explorer and ensure everything has joined up and attributes from Entra are visible as well.

Look at user in identity universe
Look at user in identity universe
Last updated 3 December 2026 Edit this page on GitHub
Esc