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.

    Source_CustomFields.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.

    Source_Systems_PS_Contract_MapAdditionalField.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()
      Source_Systems_PS_Contract_CustomField.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.

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

    Target_Systems_PS_Resources_SelectContractField.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-1.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.