Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Update User Import JSON to accept special characters in user's name

NID27
Regular Contributor
Regular Contributor

Hi,

We have user import that runs to import the user data from HRMS system to Saviynt. I have noticed that if the Firstname or Last name of the user contains any special character, it doesn't get imported into saviynt. Below is the Json, Can someone please help me in updating it in a way that it accepts "hyphen" in the firstname and Lastname. Same json is attached

 

{
"type": "multiCall",
"call": [{
"name": "call1",
"connection": "userAuth",
"url": "https://www.abc.com/Api/companyname/V1/Employees?filterUpdatedStartDate=${(new Date()-1).format('yyyy-MM-dd\\'T\\'HH:mm:ss')}&filterUpdatedEndDate=${(new Date()).format('yyyy-MM-dd\\'T\\'HH:mm:ss')}",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}"
},
"colsToPropsMap": {
"username": "XRefCode~#~char"
},
    "successResponses": {
"statusCode": [
200
]
},
"unsuccessResponses": {
"statusCode": [
400,
403,
401,
404,
409,
501,
503,
500
]
},
"userResponsePath": "Data"
},
{
"name": "call2",
"connection": "userAuth",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}"
},
"statusConfig": {
"statusColumn": "customproperty54",
"active": [
"ACTIVE",
"LOACFRA",
"LOAFMLA",
"LOAMILITARY",
"LOANYPFL",
"LOAPDL",
"LOAPERSONAL",
"LOAWORKERSCOMP"
]
},
"colsToPropsMap": {
"username": "#CONST#${List responseList = response.SSOAccounts.Items; int size = responseList.size(); if (size == 0) {return response.EmployeeNumber} else {int count = 0; Iterator iterator = responseList.iterator(); while (iterator.hasNext()) { count++; Map dataMap = iterator.next(); if (count == size) {return dataMap.LoginName.substring(0, dataMap.LoginName.indexOf('@'))}}}}~#~char ",
"firstname": "FirstName~#~char",
"lastname": "LastName~#~char",
"middlename": "MiddleName~#~char",
"preferedfirstname": "CommonName~#~char",
"employeeid": "EmployeeNumber~#~char",
"employeetype": "#CONST#${'Employee'}~#~char",
"startdate": "OriginalHireDate~#~date",
"termdate": "TerminationDate~#~date",
"Title": "WorkAssignments.Items[0].BusinessTitle~#~char",
"departmentname": "WorkAssignments.Items[0].Position.Department.ShortName~#~char",
"departmentnumber": "WorkAssignments.Items[0].Position.Department.XRefCode~#~char",
"jobcode": "WorkAssignments.Items[0].Position.Job.XRefCode~#~char",
"job_function": "WorkAssignments.Items[0].Position.Job.ShortName~#~char",
"companyname": "#CONST#${'Cross Country Healthcare'}~#~char",
"phonenumber": "#CONST#${List responseList = response.Contacts.Items; int count = 0; int size = responseList.size(); Iterator iterator = responseList.iterator(); while (iterator.hasNext()){count++; Map dataMap = iterator.next(); if('BusinessPhone'.equals(dataMap.ContactInformationType.XRefCode)){return (dataMap.ContactNumber)} else if(count == size){return null}}}~#~char",
"email": "#CONST#${List responseList = response.Contacts.Items; int count = 0; int size = responseList.size(); Iterator iterator = responseList.iterator(); while (iterator.hasNext()){count++; Map dataMap = iterator.next(); if('BusinessEmail'.equals(dataMap.ContactInformationType.XRefCode)){return (dataMap.ElectronicAddress)} else if(count == size){return null}}}~#~char",
"street": "#CONST#${List responseList = response.Addresses.Items; int count = 0; int size = responseList.size(); Iterator iterator = responseList.iterator(); while (iterator.hasNext()){count++; Map dataMap = iterator.next(); if('PrimaryResidence'.equals(dataMap.ContactInformationType.XRefCode)){return (dataMap.Address1)} else if(count == size){return null}}}~#~char",
"city": "#CONST#${List responseList = response.Addresses.Items; int count = 0; int size = responseList.size(); Iterator iterator = responseList.iterator(); while (iterator.hasNext()){count++; Map dataMap = iterator.next(); if('PrimaryResidence'.equals(dataMap.ContactInformationType.XRefCode)){return (dataMap.City)} else if(count == size){return null}}}~#~char",
"country": "#CONST#${List responseList = response.Addresses.Items; int count = 0; int size = responseList.size(); Iterator iterator = responseList.iterator(); while (iterator.hasNext()){count++; Map dataMap = iterator.next(); if('PrimaryResidence'.equals(dataMap.ContactInformationType.XRefCode)){return (dataMap.Country.XRefCode)} else if(count == size){return null}}}~#~char",
"state": "#CONST#${List responseList = response.Addresses.Items; int count = 0; int size = responseList.size(); Iterator iterator = responseList.iterator(); while (iterator.hasNext()){count++; Map dataMap = iterator.next(); if('PrimaryResidence'.equals(dataMap.ContactInformationType.XRefCode)){return (dataMap.State.XRefCode)} else if(count == size){return null}}}~#~char",
                                 "CUSTOMER": "#CONST#${List responseList = response.OrgUnitInfos.Items; int count = 0; int size = responseList.size(); Iterator iterator = responseList.iterator(); while (iterator.hasNext()){count++; Map dataMap = iterator.next(); if('FunctionalGroup'.equals(dataMap.OrgUnitDetail.OrgLevel.XRefCode) ){return (dataMap.OrgUnitDetail.ShortName)} else if(count == size){return null}}}~#~char",
"customproperty11": "EmployeeManagers.Items[0].ManagerXRefCode~#~char",
"customproperty12": "#CONST#${List responseList = response.SSOAccounts.Items; int count = 0; int size = responseList.size(); Iterator iterator = responseList.iterator(); while (iterator.hasNext()){count++; Map dataMap = iterator.next(); if(count == size) {return dataMap.LoginName}}}~#~char",
"customproperty16": "#CONST#${List responseList = response.Addresses.Items; int count = 0; int size = responseList.size(); Iterator iterator = responseList.iterator(); while (iterator.hasNext()){count++; Map dataMap = iterator.next(); if('PrimaryResidence'.equals(dataMap.ContactInformationType.XRefCode)){return (dataMap.Country.ShortName)} else if(count == size){return null}}}~#~char",
"customproperty36": "#CONST#${List responseList = response.OrgUnitInfos.Items; int count = 0; int size = responseList.size(); Iterator iterator = responseList.iterator(); while (iterator.hasNext()){count++; Map dataMap = iterator.next(); if('FunctionalGroup'.equals(dataMap.OrgUnitDetail.OrgLevel.XRefCode) ){return (dataMap.OrgUnitDetail.ShortName)} else if(count == size){return null}}}~#~char",
"customproperty44": "#CONST#${List responseList = response.Addresses.Items; int count = 0; int size = responseList.size(); Iterator iterator = responseList.iterator(); while (iterator.hasNext()){count++; Map dataMap = iterator.next(); if('PrimaryResidence'.equals(dataMap.ContactInformationType.XRefCode)){return (dataMap.PostalCode)} else if(count == size){return null}}}~#~char",
"customproperty45": "#CONST#${List responseList = response.Addresses.Items; int count = 0; int size = responseList.size(); Iterator iterator = responseList.iterator(); while (iterator.hasNext()){count++; Map dataMap = iterator.next(); if('PrimaryResidence'.equals(dataMap.ContactInformationType.XRefCode)){return (dataMap.Address2)} else if(count == size){return null}}}~#~char",
"customproperty46": "#CONST#${List responseList = response.Addresses.Items; int count = 0; int size = responseList.size(); Iterator iterator = responseList.iterator(); while (iterator.hasNext()){count++; Map dataMap = iterator.next(); if('PrimaryResidence'.equals(dataMap.ContactInformationType.XRefCode)){return (dataMap.Address3)} else if(count == size){return null}}}~#~char",
"customproperty53": "HireDate~#~date",
"customproperty54": "EmploymentStatuses.Items[0].EmploymentStatus.XRefCode~#~char",
"customproperty57": "WorkAssignments.Items[0].IsPrimary~#~char",
"customproperty58": "WorkAssignments.Items[0].Position.ShortName~#~char",
"customproperty59": "WorkAssignments.Items[0].Position.XRefCode~#~char",
"customproperty60": "EstimatedReturnDate~#~date",
                "customproperty61": "#CONST#${response.SSOAccounts.Items.size()}~#~char",
"customproperty62": "PreStartDate~#~date",
"customproperty63": "Suffix~#~char",
"customproperty64": "WorkAssignments.Items[0].IsVirtual~#~char",
"customproperty65": "PreferredLastName~#~char"
},
"successResponses": {
"statusCode": [
200
]
},
"unsuccessResponses": {
"statusCode": [
400,
403,
401,
404,
409,
501,
503,
500
]
},
"userResponsePath": "Data"
}
]
}
 
 
 
 
1 REPLY 1

Darshanjain
Saviynt Employee
Saviynt Employee

Hi @NID27 

Can you please let us know when you say special characters what are all the characters you are expecting only hyphen or any other characters.

Also there is option in global config- User Regex Validation you can keep the regex condition to include special characters and try it out.

 

Thanks

Darshan