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

Connection JSON text manipulation function substringBefore

darshanmandhane
New Contributor III
New Contributor III

We have a requirement wherein we want to update an attribute of the connected endpoint with pre-"@" symbol of the email ID.

I tried with below syntaxes, nothing worked. Can you please suggest a right way to use substringBefore function in connection JSON.

This works:

\"Username\": \"${user?.email}\" 

 

None of these work:

a. \"Username\": \"${substringBefore(user?.email, '@')}\"

b. \"Username\": \"${substringBefore(user?.email, \'@\')}\"

c. \"Username\": \"${substringBefore(user?.email, "@")}\"

d. \"Username\": \"${substringBefore(user?.email, \"@\")}\"

e. \"Username\": \"${substringBefore(user?.email, @)}\"

f. \"Username\": \"${split(user?.email, "@", 1)}\"

g. \"Username\": \"${split(user?.email, "@")[0]}\"

 

4 REPLIES 4

Raghu
All-Star
All-Star

Sample can you provide result what expecting , before '@' means we have system user right use , based on that email will generate .

\"Username\": \"${user?.systemusername}\"


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

rushikeshvartak
All-Star
All-Star

user?.email.substring(0, user?.email.indexOf('@'))


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

darshanmandhane
New Contributor III
New Contributor III

Thank you @rushikeshvartak, it worked!

FYI it should be java functions and not String functions


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