Click HERE to see how Saviynt Intelligence is transforming the industry. |
09/30/2024 12:44 PM
Hello,
If I have a user customproperty stored a very long string that is a JSON formatted data structure such as {"myAttrName1":"MyAttrValue1", "myAttrName2":"MyAttrValue2"}
When I create an account, I need get the attribute value from this customproperty. what is the easy way to traverse and access an attribute value from the String using groovy scripting allowed in Saviynt?
Such as user?.customproperty?.myAttrName2?.trim()
if no direct access allowed, what is the best way to convert this String to JSON Map and access from the Map?
Thanks
10/03/2024 02:28 AM
Hello @pahm ,
We are checking on it we will keep you posted.
Thanks.
10/06/2024 10:56 PM
Hello @pahm,
You may need to write to query like below, depending on your use case.
${user?.customproperty != null && user?.customproperty != '' ? new groovy.json.JsonSlurper().parseText(user.customproperty)?.myAttrName2?.trim() ?: 'Default Value' : 'Default Value'}
Thank,