Add a resource based on multiple contract fields
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.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
.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()
Click Apply to save the mapping.
Click New Snapshot. The new mapping is applied to your persons' contracts.
To verify the mapping, View a person's contracts for a person in the relevant source system.
You can now select the combined field as the basis for your resource in your PowerShell v1 or v2 target system.
The Resource create script will be called once per combination. In the script, split the concatenated field as needed to create your resources.
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.