Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

[ REST Connector ] Binding Variable Not working in createAccountJSON

anuragG
New Contributor III
New Contributor III

Team,

I am working on REST Connector.

To create an account, passing user's basic info in httpParams as shown below in Create Account JSON, But instead of picking the actual value it's passing the binding variable as it is. 

JSON-

{
"accountIdPath": "call1.message.id",
"call": [{
"name": "call1",
"connection": "userAuth",
"url": "https://kcbgpje8lo700tl-epdwdev.adb.us-ashburn-1.oraclecloudapps.com/ords/xrx_wpr/IDM/R_IDENTITY_SOR",
"httpMethod": "POST",
"httpParams": "{ \"XGUID\": \"${user.customproperty21}\", \"S3_USER_ID\": \"${user.username}\", \"PERSON_STATUS\": \"${requestAccessAttributes.get('PersonStatus')}\", \"LAST_NAME\": \"${user.lastname}\", \"FIRST_NAME\": \"${user.firstname}\", \"EMAIL\": \"${user.email}\", \"S3_EMPLOYEE_TYPE\": \"${user.employeetype}\", \"COUNTRY_CODE\": \"${requestAccessAttributes.get('CountryCode')}\", \"COMPANY\": \"${user.company}\", \"STREET\": \"${user.street}\", \"STATE\": \"${user.state}\", \"POSTAL_CODE\": \"${user.region}\", \"MANAGER_NAME\": \"${requestAccessAttributes.get('ManagerName')}\", \"MANAGER_XGUID\": \"${requestAccessAttributes.get('ManagerXguid')}\", \"TIME_STAMP\": \"${requestAccessAttributes.get('TS')}\", \"RECORD_TYPE\": \"NEW\", \"SOR\": \"${user.customproperty15}\", \"FEED_PK\": \"${user.customproperty40}\", \"PERSONNEL_NUMBER\": \"${user.employeeid}\" }",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [200]
}
}]
}

 

Here, instead of passing user's firstname and lastname value and other Http params from Saviynt, it is passing ${user.firstname} ${user.lastname} as it is to the target system. Hence user's account not getting created with actual name rather it name "${user.firstname} ${user.lastname}".

Point to note here: With the same JSON, when values are hardcoded then it is passing the actual hardcoded value. But when trying to capture the value using binding variable it doesn't work!

Can anyone please suggest, what could be wrong here? Am I missing anything?

24 REPLIES 24

armaanzahir
Valued Contributor
Valued Contributor

Hi @anuragG ,

 

Can you change the variable name to ${user.employeeType} and check.

Refer to the Developer's handbook for a list of all variables and their syntax:

Developers Handbook (saviyntcloud.com)

armaanzahir_1-1689247135497.png

Behaviour: Even if any one of the Binding variable is misspelt / misused, none of the binding variables get resolved.

Thanks,

Armaan

 

Regards,
Md Armaan Zahir

rushikeshvartak
All-Star
All-Star

JSON-

{
"accountIdPath": "call1.message.id",
"call": [{
"name": "call1",
"connection": "userAuth",
"url": "https://kcbgpje8lo700tl-epdwdev.adb.us-ashburn-1.oraclecloudapps.com/ords/xrx_wpr/IDM/R_IDENTITY_SOR",
"httpMethod": "POST",
"httpParams": "{ \"XGUID\": \"${user.customproperty21}\", \"S3_USER_ID\": \"${user.username}\", \"PERSON_STATUS\": \"${requestAccessAttributes.get('PersonStatus')}\", \"LAST_NAME\": \"${user.lastname}\", \"FIRST_NAME\": \"${user.firstname}\", \"EMAIL\": \"${user.email}\", \"S3_EMPLOYEE_TYPE\": \"${user.employeeType}\", \"COUNTRY_CODE\": \"${requestAccessAttributes.get('CountryCode')}\", \"COMPANY\": \"${user.company}\", \"STREET\": \"${user.street}\", \"STATE\": \"${user.state}\", \"POSTAL_CODE\": \"${user.region}\", \"MANAGER_NAME\": \"${requestAccessAttributes.get('ManagerName')}\", \"MANAGER_XGUID\": \"${requestAccessAttributes.get('ManagerXguid')}\", \"TIME_STAMP\": \"${requestAccessAttributes.get('TS')}\", \"RECORD_TYPE\": \"NEW\", \"SOR\": \"${user.customproperty15}\", \"FEED_PK\": \"${user.customproperty40}\", \"PERSONNEL_NUMBER\": \"${user.employeeid}\" }",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [200]
}
}]
}


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

anuragG
New Contributor III
New Contributor III

Update - When Dynamic attributes are hardcoded, only then the user object binding variables are working for eg below JSON works when i have hardcoded all the dynamic attributes.

{
"accountIdPath": "call1.message.id",
"call": [{
"name": "call1",
"connection": "userAuth",
"url": "https://kcbgpje8lo700tl-epdwdev.adb.us-ashburn-1.oraclecloudapps.com/ords/xrx_wpr/IDM/R_IDENTITY_SOR",
"httpMethod": "POST",
"httpParams": "{\"XGUID\": \"${user.customproperty21}\", \"S3_USER_ID\": \"${user.username}\", \"PERSON_STATUS\": \"ACT\", \"LAST_NAME\": \"${user.lastname}\", \"FIRST_NAME\": \"${user.firstname}\", \"EMAIL\": \"${user.email}\", \"S3_EMPLOYEE_TYPE\": \"${user.employeeType}\", \"COUNTRY_CODE\": \"IND\", \"COMPANY\": \"${user.companyname}\", \"STREET\": \"${user.street}\", \"STATE\": \"${user.state}\", \"POSTAL_CODE\": \"${user.region}\", \"MANAGER_NAME\": \"Nikhil Sharma\", \"MANAGER_XGUID\": \"r7370HRJ\", \"TIME_STAMP\": \"13-Jul-23\", \"RECORD_TYPE\": \"NEW\", \"SOR\": \"${user.customproperty15}\", \"FEED_PK\": \"${user.customproperty40}\", \"PERSONNEL_NUMBER\": \"${user.employeeid}\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [200]
}
}]
}

Instead of dynamic attributes name using account column there

${requestAccessAttributes.get('customproperty1')}\"

 

or also validate spelling is correct for dynamic attributes 

 

sample

https://docs.saviyntcloud.com/bundle/REST-v23x/page/Content/Developers-Handbook.htm#top

"${requestAccessAttributes.get('regions')}

Check the exact syntax from above link.


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

Hi

Is there any error that you see?

As per documentation, below should work. Please check if you are passing the correct name of the dynamic attribute.

"${requestAccessAttributes.get('ResourceOrgRoleCode')}\",\"SalesGroup_c\": \"${requestAccessAttributes.get('SalesGroup_c')}

https://docs.saviyntcloud.com/bundle/REST-v2020x/page/Content/Developers-Handbook.htm

Thanks,
Devang Gandhi
If this reply answered your question, please Accept As Solution and give Kudos to help others who may have a similar problem.

anuragG
New Contributor III
New Contributor III

Below is the lastest JSON and issue still persists. 

{
"accountIdPath": "call1.message.id",
"call": [{
"name": "call1",
"connection": "userAuth",
"url": "https://kcbgpje8lo700tl-epdwdev.adb.us-ashburn-1.oraclecloudapps.com/ords/xrx_wpr/IDM/R_IDENTITY_SOR",
"httpMethod": "POST",
"httpParams": "{ \"XGUID\": \"${user.customproperty21}\", \"S3_USER_ID\": \"${user.username}\", \"PERSON_STATUS\": \"${requestAccessAttributes.get('customproperty2')}\", \"LAST_NAME\": \"${user.lastname}\", \"FIRST_NAME\": \"${user.firstname}\", \"EMAIL\": \"${user.email}\", \"S3_EMPLOYEE_TYPE\": \"${user.employeeType}\", \"COUNTRY_CODE\": \"${requestAccessAttributes.get('customproperty3')}\", \"COMPANY\": \"${user.companyname}\", \"STREET\": \"${user.street}\", \"STATE\": \"${user.state}\", \"POSTAL_CODE\": \"${user.region}\", \"MANAGER_NAME\": \"${requestAccessAttributes.get('customproperty5')}\", \"MANAGER_XGUID\": \"${requestAccessAttributes.get('customproperty4')}\", \"TIME_STAMP\": \"${requestAccessAttributes.get('customproperty1')}\", \"RECORD_TYPE\": \"NEW\", \"SOR\": \"${user.customproperty15}\", \"FEED_PK\": \"${user.customproperty40}\", \"PERSONNEL_NUMBER\": \"${user.employeeid}\" }",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [200]
}
}]
}

 

User objects are getting populated but not the Dynamic attributes.

anuragG
New Contributor III
New Contributor III

These are the dynamic attributes if it helps -

anuragG_0-1689254236263.png

All queries are working in Data analyzer.

anuragG
New Contributor III
New Contributor III

On checking further it was found that when task are getting created for provisioning through rules (This EP is non requestable, to be provisioned as birthright to certain users based on rule), the dynamic attributes are not getting calculated. Any help there?

 

FYI everything works when we submit a request through ARS (for testing purpose only) as dynamic attributes gets calculated in that task and has this extra tab of 'Request Details'-

anuragG_1-1689264781985.png

 

Task created from rules -

anuragG_0-1689264674969.png

Am I missing something here? What can I do to have dynamic attributes get calculated for tasks created through requests?

When tasks generated outside Access Request this values will not be populated this is expected behaviour


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

Through rules you will not get DA values from requestAccessAttributes, Since you have default values assigned and mapped to account attributes as well can you try below variable and see if that works

${account.custompropertyxx}

Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.

anuragG
New Contributor III
New Contributor III

Hi @sk @rushikeshvartak Thank you for the inputs.

@sk 

${account.custompropertyxx}This doesn't work either and is getting passed as is. Any other suggestions?

armaanzahir
Valued Contributor
Valued Contributor

Hi @anuragG ,

If you need to pass in the dynamic attributes in the json, you set the default value of all the dynamic attributes in their definition and that default value would be passed for all provisioning tasks created via provisioning rules using the normal dynamic attribute variable ${requestAccessAttributes.get('SalesGroup_c')}

Various Usage of Dynamic Attributes - Saviynt Forums - 37329 - 3rd point.

Thanks,

Armaan

 

 

Regards,
Md Armaan Zahir

Are those mandatory attributes you may need to use if else if rule then don’t update


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

anuragG
New Contributor III
New Contributor III

@rushikeshvartak  Can you please elucidate?

@armaanzahir The default value cannot be static if that's what you are suggesting. It needs to be calculated for every user. Please confirm if that possible.

Does those attributes which are fetched from dynamic attributed are mandatory?

 

if those are not mandatory then use condition in json to skip those attribute passed on target 


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

armaanzahir
Valued Contributor
Valued Contributor

Hi @anuragG ,

As suggested earlier, you have the option of using an SQl query for the default value parameter of the Dynamic attributes, no matter what the attribute type is (ENUM,String etc). Please use the SQL query to evaluate the dynamic attribute value based on the user's context and the same can be referred in the creation JSON.

select customproperty32 as ID from users where username='${user.username}'

Various Usage of Dynamic Attributes - Saviynt Forums - 37329 - 3rd point.

If this does not work, please raise an FD ticket as it's expected behavior for the default value query to be evaluated and made available for creation and modification jsons.

Thanks,

Armaan

Regards,
Md Armaan Zahir

anuragG
New Contributor III
New Contributor III

@rushikeshvartak Can you please let me know the syntax for if else statements here? I am trying to accomodate all dynamic attrbutes in JSON only.

 

Also, is there any way to send system date in this format - 17-JUN-23 or DD-MON-YY. This was being done using this DA query - select date_format(CURRENT_DATE(),"%d-%b-%y") as ID

anuragG
New Contributor III
New Contributor III

@rushikeshvartak if else statement required for this DA - select case when customproperty49='Active' then 'ACT' when customproperty49='Inactive' then 'INA' else 'SEP' end as ID from users where username='${user.username}'

What is ask JSON or DA Query


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

anuragG
New Contributor III
New Contributor III

Can we call deployed JARS from connectors JSON to get values from code.

{
"accountIdPath": "call1.message.id",
"call": [{
"name": "call1",
"connection": "userAuth",
"url": "<URL>",
"httpMethod": "POST",
"httpParams": "{ \"XGUID\": \"${user.customproperty21}\", \"S3_USER_ID\": \"${user.username}\", \"PERSON_STATUS\": \"${com.adw.PersonStatus.getPersonstatus(user.customproperty49)}\", \"LAST_NAME\": \"${user.lastname}\", \"FIRST_NAME\": \"${user.firstname}\", \"EMAIL\": \"${user.email}\", \"S3_EMPLOYEE_TYPE\": \"${user.employeeType}\", \"COUNTRY_CODE\": \"CAN\", \"COMPANY\": \"${user.companyname}\", \"STREET\": \"${user.street}\", \"STATE\": \"${user.state}\", \"POSTAL_CODE\": \"${user.region}\", \"MANAGER_NAME\": \"Anurag Goyal\", \"MANAGER_XGUID\": \"x6w70\", \"TIME_STAMP\": \"${com.adw.SystemDateCalculator.getFormattedSystemDate()}\", \"RECORD_TYPE\": \"NEW\", \"SOR\": \"${user.customproperty15}\", \"FEED_PK\": \"${user.customproperty40}\", \"PERSONNEL_NUMBER\": \"${user.employeeid}\" }",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/x-www-form-urlencoded",
"successResponses": {
"statusCode": [200]
}
}]
}

 

\"TIME_STAMP\": \"${com.adw.SystemDateCalculator.getFormattedSystemDate()}\"

No


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

anuragG
New Contributor III
New Contributor III

It seems to be working -

Java Code-

anuragG_0-1689783804012.png

Payload passed-

anuragG_1-1689783875526.png

 

 

Great. Can you attach Jar here


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

anuragG
New Contributor III
New Contributor III

@rushikeshvartak  Cannot share the JAR here as it contains confidential information.

FYI, this approach is working fine, I am now able to compute the 5 DA's from a JAR deployed in Saviynt Shared location whenever a birthright Task is created from rule.