Click HERE to see how Saviynt Intelligence is transforming the industry. |
03/29/2023 01:36 AM
Hi ,
I am trying to update the account on the value of dynamic attribute. If dynamic attribute 'sqlquery' contains 'write' then pass empty string else the value of dynamic attribute.
Sample :
${if(requestAccessAttributes.get('sqlQuery').contains('Write')) {\"\"} else \"{requestAccessAttributes.get('sqlQuery')}\"}
It's throwing error for unrecognized $.
let me know where I am doing wrong.
Thanks
Geeta
Solved! Go to Solution.
03/29/2023 03:30 AM
Hi @GeSaviynt
The syntax looks correct, you can try with the below as well
${if(requestAccessAttributes.get('sqlQuery').contains('Write')) {\"\"} else \"{requestAccessAttributes.get('sqlQuery')}\"}
If this doesn't work , give me the exact json for which field you are using in which connector and may be a snippet of error logs as well
Thanks
Darshan
03/29/2023 08:14 AM
Hi Darshanjain,
Thanks for reply. But it's not working.
JSON :
{
"accountIdPath": "accountname",
"dateFormat": "yyyy-MM-dd'T'HH:mm:ssXXX",
"responseColsToPropsMap": {},
"call": [{
"name": "call1",
"connection": "userAuth",
"url": "https://abc.com/user/v9/acces",
"httpMethod": "POST",
"httpParams": "{\"AdvancedAccessRequest\": {\"adsId\": \"${user.systemUserName}\",\"service\":\"${requestAccessAttributes.get('Services')}\",\"advanced\":{\"clearCardAccessTo\":\"${requestAccessAttributes.get('clearcardaccessto')} ${requestAccessAttributes.get('Hour')}:${requestAccessAttributes.get('Min')}:${requestAccessAttributes.get('Sec')}\",\"sqlQuery\":${if(requestAccessAttributes.get('sqlQuery').contains('Write')) {\"\"} else \"{requestAccessAttributes.get('sqlQuery')}\"}}}}",
"httpHeaders": {
"Authorization": "${access_token}",
"Content-Type": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"AccessRequest.result": "Success"
}
}]
}
error : I can see in log for null object.
ssto')} ${requestAccessAttributes.get('Hour')}:${requestAccessAttributes.get('Min')}:${requestAccessAttributes.get('Sec')}","sqlQuery":"${requestAccessAttributes.get('sqlQuery')}"}}}, httpHeaders:[Authorization:${access_token}, Content-Type:application/json], httpContentType:application/json, successResponses:[AdvancedAccessRequest.result:Success]]]]
2023-03-29 14:57:46,631 [quartzScheduler_Worker-1] DEBUG rest.RestProvisioningService - Completing task - 58427
2023-03-29 14:57:46,632 [quartzScheduler_Worker-1] ERROR rest.RestProvisioningService - *****ERROR******
java.lang.NullPointerException: Cannot invoke method size() on null object
at com.saviynt.provisoning.rest.RestProvisioningService$_removeAccount_closure45.doCall(RestProvisioningService.groovy:8216)
at com.saviynt.provisoning.rest.RestProvisioningService.removeAccount(RestProvisioningService.groovy:8202)
at com.saviynt.ecm.services.ArsTaskService.removeAccountTarget(ArsTaskService.groovy:10473)
Thanks
Geeta
03/29/2023 11:16 PM
Hi @GeSaviynt
Can you confirm you are getting null object only when you use the above condition, once you remove this and pass others json is it working fine ?
Thanks
Darshan
03/30/2023 01:35 AM
Hi @Darshanjain ,
Yes, it's working. Json with out condition:
{
"accountIdPath": "accountname",
"dateFormat": "yyyy-MM-dd'T'HH:mm:ssXXX",
"responseColsToPropsMap": {},
"call": [{
"name": "call1",
"connection": "userAuth",
"url": "https://abc.com/user/access/v1/advancedAccess",
"httpMethod": "POST",
"httpParams": "{\"AdvancedAccessRequest\": {\"adsId\": \"${user.systemUserName}\",\"service\":\"${requestAccessAttributes.get('Services')}\",\"advanced\":{\"clearCardAccessTo\":\"${requestAccessAttributes.get('clearcardaccessto')} ${requestAccessAttributes.get('Hour')}:${requestAccessAttributes.get('Min')}:${requestAccessAttributes.get('Sec')}\",\"sqlQuery\":${if(requestAccessAttributes.get('sqlQuery').contains('Write')) {\"\"} else \"{requestAccessAttributes.get('sqlQuery')}\"}}}}",
"httpHeaders": {
"Authorization": "${access_token}",
"Content-Type": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"AdvancedAccessRequest.result": "Success"
}
}]
}
Thanks
Geeta
03/30/2023 08:16 AM
Hi,
Now, it's a working.
Thanks
Geeta
03/30/2023 08:18 AM
Hi,
Issue was for syntax.
Thanks
Geeta
03/30/2023 11:58 PM
Hi @GeSaviynt
Good to hear that the issue has been resolved.
If you can share the working json as well so that others referring this can make use of it.
Thanks
Darshan