03/07/2023 08:11 AM
When importing users from Workday with the soap connector, there is a field with a formatted address which contains a semicolon and newline html characters (
) to separate the street, from city, zip, etc. It looks like this in the response:
"123 Elm Ave.
Liberty, MO 60192
United States of America"
When imported in to an user customproperty field it strips out those characters and looks like this:
"123 Elm Ave.Liberty, MO 60192United States of America"
I have tried the mapping to the various size customproperties (tiny text, Medium text, and Long text) but it always strips it out. Is there a way to preserve this or catch in preprocessor before it does and replace with a semi-colon or something?
Here is an example of the mapping of this field in the userimportmappings:
"CUSTOMPROPERTY60":"Worker_Data.Personal_Data.Contact_Data.Address_Data(Usage_Data->Type_Data->Type_Reference->ID=='WORK').@Formatted_Address"
Solved! Go to Solution.
03/07/2023 09:35 PM - edited 03/09/2023 12:18 AM
I appreciate you reaching out to the Saviynt forums.
#It seems like the SOAP connector is removing the HTML newline character when importing the data to the custom property field. One solution could be to modify the SOAP connector's preprocessor to replace the HTML newline character with a semicolon or another separator before importing the data.
Here's an example of how to replace the HTML newline character with a semicolon in Python ,Jason :
Python
address = "123 Elm Ave.
Liberty, MO 60192
United States of America"
formatted_address = address.replace('
', ';')
print(formatted_address)
Output:-
123 Elm Ave.;Liberty, MO 60192;United States of America
Json format
import json
address = "123 Elm Ave.
Liberty, MO 60192
United States of America"
formatted_address = address.replace('
', ';')
json_data = json.dumps({'formatted_address': formatted_address})
print(json_data)
Output:-
{"formatted_address": "123 Elm Ave.;Liberty, MO 60192;United States of America"}
#You can modify the JSON structure to match your requirements.
#You can modify the preprocessor code to include this replacement logic and then import the data to the custom property field.
Please let me know if further information is needed on this.
03/08/2023 05:28 PM
I was able to use a replace statement in the modifyUserJson preprocessor. Thank you for your assistance
03/09/2023 12:20 AM
Can you share modifyUserJson
03/09/2023 07:53 AM
I have this field going to customproperty46 on the user. They wanted a comma instead of a semi-colon for the separator. So I just added customproperty46 to the computed columns and added this to the preprocessorqueries:
"UPDATE NEWUSERDATA SET CUSTOMPROPERTY46 = REPLACE (CUSTOMPROPERTY46, '
', ', ')"
03/09/2023 12:18 AM
Thanks for the update we will mark this as a solution.