Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Passing single quotes as an actual value in rest jsom

NM
Honored Contributor II
Honored Contributor II

Hi Team, has anyone passed single quotes as an actual value in rest json?

I tried using backslash but didn't work.

Thanks

 

13 REPLIES 13

rushikeshvartak
All-Star
All-Star

Share json


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

NM
Honored Contributor II
Honored Contributor II

@rushikeshvartak we need to pass a script in http param

Param looks like.

Script:select username, ID from user wher username ='name' and we need to add name in single quotes

Add blackslash


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

NM
Honored Contributor II
Honored Contributor II

@rushikeshvartak tried that .. couldn't save the connection.

Share error logs / json


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

NM
Honored Contributor II
Honored Contributor II

@rushikeshvartak here is the json not working with backslash

{
"name": "call1",
"connection": "acctAuth",
"url": "",
"httpMethod": "POST",
"httpContentType": "application/json",
"httpParams": "${\"Script\":\"Select Username, ID, status, email, displayname, sourceds from User where upper(username) = upper('+'\''+abc+'\''+') ORDER BY Username\"'}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"successResponses": {
"statusCode": [
200
]
},
"unsuccessResponses": {
"statusCode": [
404,
401,
400
]
}
}

"httpParams": "${\"Script\":\"Select Username, ID, status, email, displayname, sourceds from User where upper(username) = upper('\\\\'abc\\\\') ORDER BY Username\"}",


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

NM
Honored Contributor II
Honored Contributor II

@rushikeshvartak need to add single quotes in json

Its added in above logic


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

NM
Honored Contributor II
Honored Contributor II

@rushikeshvartak it is adding backslash instead of single quote

\"Script\":\"Select Username, ID, status from user where upper(username) = upper(\\abc\\)

abc is dynamic value which we are picking from task account name


"httpParams": "{\"Script\":\"Select Username, ID, status, email, displayname, sourceds from User where upper(username) = upper('\" + abc + \"') ORDER BY Username\"}"


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

NM
Honored Contributor II
Honored Contributor II

@rushikeshvartak , i have already tried above...

i was able to make it work. will share the working one just testing few scenarios.

Thank you!!

NM
Honored Contributor II
Honored Contributor II

working Json

"httpParams": "{\"Script\":\"Select Username, ID, status, email, displayname, sourceds from User where upper(username) = upper('\\\" + abc + '\\\''+') ORDER BY Username\"}

 

Thank you so much @rushikeshvartak for always helping out.