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

Need sample for CreateAccountJSON parsing value from user.customproperty

moosam2
New Contributor III
New Contributor III

Hi guys, 

I'm testing about parsing specific value from  User's customproperty using Multivalue as below.

Is there any suggestion CreateAccountJSON for below case?

Scenario

1. User has multi-valued customproperty -> User.customproperty29 (Value = 'A:B:C:D')

* If B is Empty for some users, value will be 'A::C:D'

2. Endpoint is integrated with REST and need 4 values for Create Account as below

- Arg1 : A

- Arg2 : B

- Arg3 : C

- Arg4 : D

3. on above case, i want to write createAccountJSON but failed

 
[Sample  Data]
 
\"Arg1\": \"${(customPropertyValue = user.get('CustomProperty29')) ? ((valuesArray = customPropertyValue.split(':', -1)).size() > 1 ? valuesArray[1] : '') : ''}\",
\"Arg2\": \"${(customPropertyValue = user.get('CustomProperty29')) ? ((valuesArray = customPropertyValue.split(':', -1)).size() > 1 ? valuesArray[2] : '') : ''}\",
\"Arg3\": \"${(customPropertyValue = user.get('CustomProperty29')) ? ((valuesArray = customPropertyValue.split(':', -1)).size() > 1 ? valuesArray[3] : '') : ''}\",
\"Arg4\": \"${(customPropertyValue = user.get('CustomProperty29')) ? ((valuesArray = customPropertyValue.split(':', -1)).size() > 1 ? valuesArray[4] : '') : ''}\",

Thank you.

2 REPLIES 2

NM
Honored Contributor III
Honored Contributor III

@moosam2 try this

\"Arg1\": \"${(user.customproperty29.split(':')[0]=='')?'': user.customproperty29.split(':')[0]}\"

Create similarly for others.


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

rushikeshvartak
All-Star
All-Star

{
"Arg1": "${user?.customproperty29?.substring(0, user?.customproperty29?.indexOf(':')) ?: ''}",
"Arg2": "${user?.customproperty29?.substring(user?.customproperty29?.indexOf(':') + 1, user?.customproperty29?.indexOf(':', user?.customproperty29?.indexOf(':') + 1)) ?: ''}",
"Arg3": "${user?.customproperty29?.substring(user?.customproperty29?.indexOf(':', user?.customproperty29?.indexOf(':') + 1) + 1, user?.customproperty29?.lastIndexOf(':')) ?: ''}",
"Arg4": "${user?.customproperty29?.substring(user?.customproperty29?.lastIndexOf(':') + 1) ?: ''}"
}


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