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

Syntax to check if else condition in GRANTACCESSJSON of DB connection

harishyara
Regular Contributor
Regular Contributor

Hello All,

We have a use case to update DB statements based on entitlement value

Please help me with syntax which can be used in GRANTACCESSJSON of DB connection

Logic as follows - 

IF < users entitlement value is Developer >

THEN UPDATE USERS Set TITLE = 'Developer' where LOGINID = '${task.accountName}'

ELSE

UPDATE USERS Set DEPT = '${task.entitlement_valueKey.entitlement_value}' where LOGINID = '${task.accountName}'

Regards,

Harish

1 REPLY 1

armaanzahir
Valued Contributor
Valued Contributor

Hi @harishyara 

You can try leveraging the JSONBuilder option for this where you can have if else statements for inserting records into your map.

Below is the forum reference:

(1) Solved: Multiple Inserts in CreateaccountJSON of the DB Co... - Saviynt Forums - 43584

Common questions around using Groovy functions/scr... - Saviynt Forums - 42909

 

Regards,
Md Armaan Zahir