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

Substring-tostring logic check

Happy333
New Contributor
New Contributor

In a REST connector implementation, based on the country what user has selected in dynamic form (value stored in accountCP26) on ARS page we need to assign the language value. The values would be AE - Armenia, PL - Poland etc. Hence, we are just reading the first 2 alphabets. However, the below syntax is not working as expected. The else condition value 'en_US' is getting mapped by default. Can you please confirm if there is any syntax issue with the substring or tostring conversion?

\"language\":\"${if(requestAccessAttributes.customproperty26.toString().substring(0,2)=='AE') 'ar_AE' else if(requestAccessAttributes.customproperty26.toString().substring(0,2)=='AL') 'es_US' else 'en_US'}\"

Or if there is any alternative way or logic to achieve this requirement, kindly suggest.

[This message has been edited by moderator to merge reply comment]

2 REPLIES 2

SB
Saviynt Employee
Saviynt Employee

Can you try with request_access_attrs.customproperty26 instead. Also, you can refer the below form link to check for the format of if else clause.

https://forums.saviynt.com/t5/identity-governance/if-else-condition-in-removeaccountjson/m-p/34949#M...


Regards,
Sahil

rushikeshvartak
All-Star
All-Star

\"language\":\"${if(request_access_attrs?.customproperty26.toString().substring(0,2)=='AE') 'ar_AE' else if(request_access_attrs?..customproperty26.toString().substring(0,2)=='AL') 'es_US' else 'en_US'}\"


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