We have multiple address fields in our source file and would like to populate the street address of the users in multiline format by combining the values from multiple address fields.
Desired address format:
We will be using a Synchronize job to take the address values from multiple fields in the source file and populate them in the Street Address field in multiline format for user/contact objects in a directory.
- In GroupID Management Console, select Synchronize > All Jobs and then click New Job in the Actions pane.
- On the Select Source page of the New Job wizard, provide the source file and the required information.
- Go through the pages of the wizard until you reach the Field Mapping page.
- For Street Address, click the Transform button and then click Edit Script, as shown below:
- On clicking Edit Script, a script editor will open with all the source file fields listed on the left side. Copy the script provided below and modify the field names according to your requirement.
Dim s as String =""
If (DTM.Source("House Number").Trim() <> "") Then
s = s & DTM.Source("House Number").Trim()
If (DTM.Source("Street").Trim() <> "") Then
s = s & vbCrLf & DTM.Source("Street").Trim()
If (DTM.Source("Area").Trim() <> "") Then
s= s & vbCrLf & DTM.Source("Area").Trim()
If (DTM.Source("City").Trim() <> "") Then
s= s & vbCrLf & DTM.Source("City").Trim()
DTM.Result = s
In the script editor, the script should appear as:
- Once you have edited the script, click the check mark to test and then click OK to return to the New Job wizard.
- On the Completion page of the wizard, click the Preview job when finished checkbox if you would like to preview the job when you complete the wizard.
- Run the job to verify the results.