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

Connection JSON text manipulation function substringBefore

darshanmandhane
New Contributor II
New Contributor II

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
Valued Contributor III
Valued Contributor III

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 you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

darshanmandhane
New Contributor II
New Contributor II

Thank you @rushikeshvartak, it worked!

FYI it should be java functions and not String functions


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