Click HERE to see how Saviynt Intelligence is transforming the industry. |
10/16/2024 02:33 AM - edited 10/16/2024 03:31 AM
Hi folks,
I’m currently working with the following createAccountJSON:
The API response is no-content, and I want to capture the validity value that I send in the API call into the account's customproperty10.
Currently, I’ve set the ColsToPropsMap to map customproperty10 using the same logic for validity. However, it doesn’t seem to work as expected. Can someone help guide me on how to properly capture and map the validity field sent via the API call to customproperty10?
Thanks in advance!
10/16/2024 02:54 AM
@alvian share the api response.
10/16/2024 03:16 AM
the API just response a status code 204 with no content
10/16/2024 03:21 AM
@alvian colstoprop is to used to set the value recieved in response.
Workaround
I believe validity is a DA so map the validity account field to customproperty10 it will work and map the value.
10/16/2024 03:30 AM
Yes @NM , I understand that DA values can be automatically mapped to account attributes. However, what I need is to populate the account attribute with the variable ${(requestAccessAttributes?.get('Validity') == '1Month') ? Calendar.getInstance().with { it.add(Calendar.DAY_OF_YEAR, 30); it.time }.format('yyyy-MM-dd HH:mm:ss')} that I sent to the target.
here is the DA settings
10/16/2024 03:42 AM
@alvian can we you can retrieve the value that you are sending ?
For single user get api?
10/16/2024 04:18 AM
Ohh okay you mean to create another call to retrieve all the data that I need yap ?
I've add an another call to get that data
this is the sample response:
{"name":"Avendor1","email":"Avendor1@example.com","productOwner":"P1","role":"role1","validity":"2025-04-14 11:11:02"},"code":200},"statusCode":200,"description":null,"status":"Success"}}
I also create this responseColsToPropsMap
"responseColsToPropsMap": {
"customproperty3": "call2.message.validity~#~char",
"customproperty4": "call2.message.email~#~char",
"customproperty10": "call2.message.validity.substring(0, 10)~#~char"
},
but somehow there no value is added into that customproperty, any idea?
10/16/2024 04:34 AM
@alvian just try this much
customproperty10": "call2.message.validity~#~char"
10/16/2024 04:40 AM
I want to get yyyy-mm-dd that's why I put .substring(0,9) 😅
10/16/2024 04:59 AM
@alvian use CONST you will find the sample in developer handbook
If you found the solution helpful please click on kudos button and accept solution.
Thanks.
10/16/2024 05:38 AM
@alvian did the below suggestion worked?
10/16/2024 05:42 AM
"customproperty10": "#CONST#${call2.message.validity?.substring(0, 10)}~#~char"
now I'm using this parameter but is not work, what I confused is the same variable CONST is work on import account
10/16/2024 05:48 AM
@alvian try this s
"customproperty10": "#CONST#${String acctId = response.call1.message.validity; acctId = acctId.substring(0,9 ); return acctId}~#~char"