Announcing the SAVIYNT KNOWLEDGE EXCHANGE unifying the Saviynt forums, documentation, training, and more in a single search tool across platforms. Click HERE to read the Announcement.

Issue in getting dynamic attribute in DB update account JSON

avinashR
New Contributor III
New Contributor III

HI Team,

I am referring the dynamic attribute in the Grant access JSON and it is working as expected.

But when I am referring the same in update account JSON it is getting failed.

Expression I am using.

Dynamic attribute name: Role

Grant access Json:

{
"Client" : [
"EXEC Usp_add_user_role @I_LAN_ID = '${task.accountName}', @I_Lifecycle = 'DEV', @I_Role_ID = '${String rl;rl=Role;rl=rl.substring(rl.indexOf(\'_\')+1);if(rl != null){return rl}}', @I_Perform_By = 'Saviynt'"
]
}

Update Account JSON:

{"UpdateAccountQry":["EXEC Usp_add_user_role @I_LAN_ID = '${task.accountName}', @I_Lifecycle = 'DEV', @I_Role_ID ='${String rl;rl=Role;rl=rl.substring(rl.indexOf(\'_\')+1);if(rl != null){return rl}}', @I_Perform_By = 'Saviynt'"]}

FYI, I am storing the dynamic attribute in account cp5. So, I tried getting the value from it as well but it is also getting failed

Please let me know if you have any suggestions.

Thanks & Regards,
Avinash Repalle

6 REPLIES 6

rushikeshvartak
All-Star
All-Star

Can you higlight DA in updateaccountjson

try ${Role}

Hope you are storing dynamic attribute value in accounts column


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

avinashR
New Contributor III
New Contributor III

${Role}: is returning value.

But my ${Role} will return something like access_125 then I need 125 in the update account JSON.

Issue: if I am using string functions along with ${Role} it is not working as expected

${Role}.split('_')[0]


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

Hi,

Is this confirmed working in 2021.x? Whenever I try to split in addaccessjson it shows syntax error while trying to save endpoint

Use. Substring 


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

I figured out what was wrong. In ${Role}.split("_")[0]. Instead of "_" need to user single quotes. Like '_'.