and more in a single search tool across platforms. Read the announcement here. |
03/20/2024 03:59 AM
Hello everyone,
I'm looking for a way to extract the string "Active" from the "ObjectStatus" key in the following JSON response and map it to the Saviynt attribute in ImportAccountJson.
responseText:[{"Name":"ABCD.Aravind","UserName":"Aravind","DisplayName":"Aravind","ObjectStatus":"System.ConfigItem.ObjectStatusEnum.Active"},{"response":"Success","Description":"Accounts reconciled successfully "}], cookies:[], statusCode:200]
I've attempted the following approach:
#CONST#${String S = response.ObjectStatus.split('.')[3]; return S}
#CONST#${response.call1.message.ObjectStatus.substring(ObjectStatus.lastIndexOf('.') + 1)}~#~char
#CONST#${responseText.ObjectStatus.substring(ObjectStatus.lastIndexOf('.') + 1)}~#~char
Has anyone encountered a similar situation with extracting values from enum types in JSON responses? Any suggestions on how to accomplish this would be greatly appreciated.
Thank you,
Aravind.
03/21/2024 03:07 AM
try like below, it will help full
"customproperty11": "#CONST#${(response['Custom Fields'][0].value == '') ? '' : response['Custom Fields'][0].value.substring(response['Custom Fields'][0].value.indexOf('(') + 1, response['Custom Fields'][0].value.indexOf('_'))}~#~char",
03/21/2024 06:25 AM - edited 03/21/2024 06:25 AM
Hi,
I am not required If else condition logic. I need to extract the 'Active' string from the ObjectStatus Key, i.e., 'System. ConfigItem.ObjectStatusEnum.Active'
Regards,
Aravind.
03/21/2024 07:44 PM
03/26/2024 11:27 AM
Hi,
#CONST#${responseText.find { it.Name == 'ABCD.Aravind' }.ObjectStatus.split("\\.")[3]}~#~char ,This is also not getting the "active" string from ObjectStatus. In CustomProperty19, it is being populated, as shown below.
I required the 'Active' string from ObjectStatus in the ImportAccount scenario.
Regards,
Aravind