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

Custom Connector - resolving dynamic attributes from CreateAccountJSON

IAM_99
Regular Contributor II
Regular Contributor II

Hi All,

We are working on Custom Connector -  

CreateAccountJSON :

~~~~~~~~~~~~~~~~~~~~~~~~~~~~

{"account_name":"${user?.firstname}"}

As per Documentation using below 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

GroovyService.convertTemplateToString(entry.getValue().toString(), model)

its throwing below errors:

groovy.lang.MissingPropertyException: No such property: user for class: SimpleTemplateScript2;groovy.lang.MissingPropertyException: No such property: users for class: SimpleTemplateScript3
 
any idea ? what should be dynamic variable for custom connector code ?

 

 

 

9 REPLIES 9

rushikeshvartak
All-Star
All-Star

Try

{"account_name":"${users?.firstname}"}


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

IAM_99
Regular Contributor II
Regular Contributor II

Hello @rushikeshvartak  tried that as well 

No such property: users for class: SimpleTemplateScript3

IAM_99
Regular Contributor II
Regular Contributor II

QQ - as documentation this is to be used to resolve groovy variables -  GroovyService.convertTemplateToString(entry.getValue().toString(), model)

above model is   of Map<String,Object> type - what is the use of this ?

It seems you need to define object in Java code

https://docs.saviyntcloud.com/bundle/SCF_v23x/page/Content/Tutorial-for-Creating-a-Custom-Connector-...


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

IAM_99
Regular Contributor II
Regular Contributor II

Can you please mentioned which number  you are referring for object declaration ?

rushikeshvartak
All-Star
All-Star

can you try USER

https://github.com/saviynt/sampleConnector/blob/master/src/main/java/com/external/sample/SampleConne...


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

IAM_99
Regular Contributor II
Regular Contributor II

Yeah, We followed same, but there is no much details on how to read groovy variables.

IAM_99
Regular Contributor II
Regular Contributor II

We need to write logic to resolve Dynamic variables ( previous understanding was it will happen automatically), we used below which resolved the issue.

GroovyService.convertTemplateToString(jsonAsStringFromUI, data); 

jsonAsStringFromUI - CreateAccountJSON as String

Data - Saviynt data Map

 

Its used in code or json


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