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

Dynamic substitution of values in httpParams

AS5278
Regular Contributor II
Regular Contributor II

Hi,

We are passing the following string in httpsParams of a call in accntEntParams JSON.

"httpParams": "{\"query\":\"{organization(login:\\\"myOrgName\\\"){samlIdentityProvider{externalIdentities(first: 100, login:\\\"A20684\\\"){edges{node{user{id login name email avatarUrl}samlIdentity{nameId username} }}}}}}\"}"

The above httpParams where I have used hardcoded accountName, 'A20684', is working fine.

Now, I need to substitute the value of accountName from call1.(For each account fetched in call1 this second call is to be made).

How can this be achieved?.

I am trying below but it isn't working:

"call2": {
"callOrder": 1,
"stageNumber": 1,
"http": {
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "*/*",
"Accept-Encoding": "gzip, deflate, br"
},
"httpContentType": "application/json",
"httpMethod": "POST",
"httpParams": "{\"query\":\"${  '{organization(login:\\\"<myOrgName>\\\"){samlIdentityProvider{externalIdentities(first: 100, login:\\\"'+accountName+'\\\"){edges{node{user{id login name email avatarUrl}samlIdentity{nameId username} }}}}}}'}\"}"
},
"inputParams": {
"dependentCall": true
},
"listField": "",
"keyField": "accountID",
"nextApiKeyField": "username",
"colsToPropsMap": {
"accountID": "data.organization.samlIdentityProvider.externalIdentities.edges[0].node.user.id~#~char",
"name": "data.organization.samlIdentityProvider.externalIdentities.edges[0].node.user.login~#~char",
                                        "customproperty1": "data.organization.samlIdentityProvider.externalIdentities.edges[0].node.user.avatarUrl~#~char"
}
 
}
 
Please advice.
Thanks,
Atul Singh

 

xurde
2 REPLIES 2

adriencosson
Valued Contributor
Valued Contributor

Hi @AS5278 ,

You can use the below sample to get the value of the accountName from call1 in call2 :

${response.call1.message.accountName}

 (supposing your response JSON contains the value in the "accountName" key) Otherwise, replace it with the path where the needed value is stored.

Hope this helps !

Regards,
Adrien COSSON

AS5278
Regular Contributor II
Regular Contributor II

@adriencosson 

We have to call the second call (call2) for each account imported in call1. Saviynt REST connector guide says to use the inputParams {"dependentCall": true} and "nextAPIKeyField" to achieve this.

This works when I use REST connector. But, I am using the GitHub Connector and in GitHub Connector the same JSON is not working. But its working in REST connector.

xurde