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

How to replace special character(') in update accountJSON(DB Connector)

AravindK
Regular Contributor
Regular Contributor

Hi Team, 

We are using DB connector and user's have special characters in the firstname and lastname . 
Target do not accept the special characters and while sending from Saviynt special characters has to be removed/replaced and send the data.
Ex:
'allen 
blaz'ez

We are trying below syntax to replace special character with empty and trying to provision but it is not working.

givenName = '${user.firstname}.replace(''','')      

Please help with the syntax.

14 REPLIES 14

Saathvik
All-Star
All-Star

Try this

'${user.firstname.replace(''','')}'


Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.

Rajesh_IAM
Regular Contributor
Regular Contributor

@Saathvik . I have tried this syntax and still getting error.
SAV - Error while creating account - xxxxxxxxx- Exception occured in Create Account Query - Incorrect syntax near 'Hakan'.

In the logs do you see special char getting replaced? What is the full command you have used in CreateAccountJSON, Can you please share it? And if possible share log snippet


Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.

Vajra
New Contributor III
New Contributor III

is this resolved . in our case we dont want to replace we just want to provision as is, and its DB Connector guys. we cannot do ""

Vajra
New Contributor III
New Contributor III

'${user.displayname}'   is used in updateaccountquery

dgandhi
All-Star
All-Star

Hi @AravindK 

Can you try below?

'${user.firstname.replaceAll(''','')}'

 

Thanks,
Devang Gandhi
If this reply answered your question, please Accept As Solution and give Kudos to help others who may have a similar problem.

Rajesh_IAM
Regular Contributor
Regular Contributor

@dgandhi  I have tried this syntax also, but still getting error.
SAV - Error while creating account - xxxxxxxxx- Exception occured in Create Account Query - Incorrect syntax near 'Hakan'.

@Rajesh_IAM  can you try the below format?

${user.firstname.replaceAll(/'/, "")}
Regards,
Naveen Sakleshpur
If this reply answered your question, please click the Accept As Solution button to help future users who may have a similar problem.

Hi,

Is this issue is resolved?

best regards,

Aditya Chadde

pmahalle
All-Star
All-Star

Hi @Rajesh_IAM ,

Try below expression, which will remove all the characters other than a-z, A-Z and 0-9

${user.firstname.replaceAll('[^a-zA-Z0-9 ]','')}

Regards,


Pandharinath Mahalle(Paddy)
If this reply helps your question, please consider selecting Accept As Solution and hit Kudos 🙂

rushikeshvartak
All-Star
All-Star

"${user.firstname}"


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Vajra
New Contributor III
New Contributor III

"update <tablename> set display_name = '${user.displayname} ' where Object_id='${task.accountName}'

displayname contains Kerry O'Leary

Vajra
New Contributor III
New Contributor III

"update <tablename> set display_name = '${user.displayname} ' where Object_id='${task.accountName}'" -this is actual

 

${org.apache.commons.lang.StringEscapeUtils.escapeSql(user.displayname)} 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.