Click HERE to see how Saviynt Intelligence is transforming the industry. |
08/24/2023 11:41 AM
Hi Team,
I have value coming from dynamic attribute as a combination of letters and number for eg. Agent-11190 . We want to send only the number as an integer in the CreateAccountJson (eg : 11190). Does anybody have any idea how to send the integer value from this string?
I am trying to get the number from the entire string using the below code however it is throwing an erorr since the number generated from below code is a String.
requestAccessAttributes.get('Profile').substring(requestAccessAttributes.get('Profile').lastIndexOf('-')+1)
Please assist.
Thanks & Regards,
Nimesh
Solved! Go to Solution.
08/24/2023 12:58 PM - edited 08/24/2023 01:00 PM
Hi @Nimesh ,
Try below:
${Profile.substring(Profile.indexOf('-')+1)}
08/25/2023 08:59 AM
Hi Pandharinath,
This will give the result as String right? I want to convert this and send as an integer in the JSON.
Can you please guide me with the syntax for that?
Regards,
NImesh
08/25/2023 09:49 AM
@Nimesh Can you try above and check once.
08/28/2023 06:57 AM
Hi Pandharinath,
I have tried this and it is not working.
Please note that it is working fine if I use the same json with hardcoded profile id as \"profileId\": 15617
Regards,
Nimesh
09/01/2023 10:33 AM
Hi Pandharinath/Team,
Anybody has any inputs on this?
Regards,
Nimesh
09/07/2023 09:03 AM - edited 09/07/2023 09:03 AM
Can you try with the below and see if it converts the value to int
${Profile.substring(Profile.indexOf('-')+1).toInteger()}
09/07/2023 09:19 AM
Below config has worked for me.
\"profileId\":${requestAccessAttributes.get('Profile').substring(requestAccessAttributes.get('Profile').lastIndexOf('-')+1)}}]}
Note : Have this without double quotes for integer.