Click HERE to see how Saviynt Intelligence is transforming the industry. |
12/19/2023 05:37 AM
Hi Team,
I want to pass values like "/api/sample/17", "/api/sample/16", "/api/sample/15", "/api/sample/14"
based on If-Else condition in CreateAccount JSON.
When I try IF-ELSE condition, it throws error like - "An account with the user field value of '${user.username}' already exists".
When I do not use IF-ELSE condition, it successfully passes the values without any issue.
Attaching JSON and logs for reference. please let me know a solution for this.
Solved! Go to Solution.
12/19/2023 05:38 AM
12/19/2023 05:48 AM
@vivekrajan Try below
\"${if(user.departmentname == 'Avaya Operations'){'/api/sample/17'} else{'/api/sample/10'}}\"
\"${if(user.departmentname.equals('Avaya Operations')){'/api/sample/17'} else{'/api/sample/10'}}\"
12/19/2023 05:49 AM
Have you tried using the ternary operator?
${(user.departmentname=='Avaya Operations')?'/api/sample/17':'/api/sample/10'}
Check if this works for you.
12/19/2023 07:14 AM
Thanks Sumathi and Armaan, I found the logical mistake after comparing your sample code.