We are delighted to share our new EIC Delivery Methodology for efficiently managing Saviynt Implementations and delivering quick time to value. CLICK HERE.

Substring after a character

JasmeenB
New Contributor II
New Contributor II

Hi team,

We have a requirement to get the group for users, but the group which we get from rest api is 

"10014113~DLV2000 Construction Crew"

We need to get the value after the character '~'. 

we have written below inline preprocessor query, but this does not work. 

Could you please let us know what to use to get this substring.

"UPDATE NEWUSERDATA LEFT JOIN CURRENTUSERS ON NEWUSERDATA.USERNAME = CURRENTUSERS.USERNAME SET NEWUSERDATA.customproperty54 = substring(CURRENTUSERS.customproperty11,CHARINDEX('~',CURRENTUSERS.customproperty11) + LEN('~'), LEN(CURRENTUSERS.customproperty11))

2 REPLIES 2

RakeshMG
Saviynt Employee
Saviynt Employee

Please use SUBSTRING_INDEX("10014113~DLV2000 Construction Crew", "~", -1)

 

RakeshMG_0-1682065256073.png

 


​Regards

Rakesh M Goudar

sudeshjaiswal
Saviynt Employee
Saviynt Employee

Hello @JasmeenB

You May try to use this query to achieve this,

"UPDATE NEWUSERDATA LEFT JOIN CURRENTUSERS ON NEWUSERDATA.USERNAME = CURRENTUSERS.USERNAME SET NEWUSERDATA.customproperty54 = SUBSTRING_INDEX(CURRENTUSERS.customproperty11,'~',-1)"

Thanks

If you find the above response useful, Kindly Mark it as "Accept As Solution".