Skip to main content

HelloID

Add a resource based on multiple contract fields
  1. Add a custom person or contract field to add a new contract field that will hold the combination (concatenation) of other contract fields.

    For this example, we will add a contract field named DeptCodeTitleCode, which will combine the department code and title code fields.

    1.jpg
  2. For the relevant source system, Map an additional field for the contract field you created in step (1).

    For this example, we'll map DeptCodeTitleCode.

    3.jpg
    1. For the mapping type, select Complex. Write a JavaScript mapping function that concatenates the relevant contract fields.

      For this example, we'll use the following function:

      function getResourceString() {
          return sourceContract.DepartmentCode.concat("#").concat(sourceContract.TitleCode);
      }
      
      getResourceString()
      4.jpg
    2. Click Apply to save the mapping.

  3. Click New Snapshot. The new mapping is applied to your persons' contracts.

    1. Optional: To verify the mapping, View a person's contracts for a person in the relevant source system.

      6.jpg
  4. You can now select the combined field as the basis for your resource in your PowerShell v1 or v2 target system.

    7.jpg
  5. The Resource create script will be called once per combination. In the script, split the concatenated field as needed to create your resources.

    8.jpg

    See Add a resource for more information on adding a resource.

    Note

    The number of unique values is limited to 100,000. If you exceed this limit, resources will not be created when you Run with resources.