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

how to handle dollar sign $ in variable binding

Lynn
New Contributor III
New Contributor III

Hello Team,
In a REST connection. I defined some variables in ConnectionJSON and tried to use them in ImportAccountEntJSON.

httpParams contained multiple parameters, host, port and authMethod should be from ConnectionJSON via binding variables. There are also additional parameters.

when I included dollar sign $ as value (in my example, it is "$T") in any of the additional parameters, it will cause the variables binding not working.

value of host will become "${connection.ConnectionInfo.host}" instead of the value "host70.ca" from ConnectionJSON.

if I removed the value with dollar sign, variables binding worked.

Do I need to escape $? I tried \\$, but it did not worked.


Below is the details of ConnectionJSON and ImportAccountEntJSON


"ConnectionJSON": {
"authentications": {
"OSService": {
"authType": "oauth2",
"url": "https://hostname/api/TestConnection",
"httpParams": {
"password": "Snp@ssw0rd",
"grant_type": "password",
"scope": "useraccount",
"client_id": "3c774f2fb7e83110cdb30652042d0ba9",
"client_secret": "`$v9R3m7[O",
"username": "admin"

},
"ConnectionInfo": {
"host": "host70.ca",
"port": "443",
"authMethod": "password"
} ,
"httpHeaders": {
"Content-Type": "application/x-www-form-urlencoded" },
"authError": [
"InvalidAuthenticationToken" ],
"httpMethod": "POST",
"httpContentType": "application/x-www-form-urlencoded",
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"retryFailureStatusCode": [401],
"accessToken": "Bearer token"
}
}
}

"ImportAccountEntJSON": {
"accountParams": {
"processingType":"SequentialAndIterative",
"connection": "OSService",
"createUsers": false,
"call": {
"call1": {
"http": {
"url": "https://hostname/api/getAllUsers",
"basicUrl": "<domain name>",
"hostUrl": "/api/getAllUsers",
"httpContentType": "application/json",
"httpMethod": "POST",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpParams": "{\"connectionInfo\": {\"host\": \"${connection.ConnectionInfo.host}\",
\"port\": \"${connection.ConnectionInfo.port}\",
\"authMethod\": \"${connection.ConnectionInfo.authMethod}\"
},\"customFilter\": {\"attribute_name\": \"uid\", \"filter_operator\": \"notstartswith\", \"values\": [\"T\", \"@T\", \"$T\"]}

}"

},
"listField": "result",
"keyField": "accountID",
"colsToPropsMap": {
"accountID": "uid~#~char",
"name": "username~#~char",
"displayName": "username~#~char",
"status": "#CONST#true~#~char"
}}}
}
}

Thanks in advance.

Regards,

Lynn

7 REPLIES 7

sudeshjaiswal
Saviynt Employee
Saviynt Employee

Hello @Lynn,

Can you provide the screenshot of the Body of HTTP Paramater from the ImportAccountEntJSON,
Also to pass the information from the connection json to importaccountjson, woud be as as below..

 

"ConnectionJSON": {
    "authentications": {
        "OSService": {
            "authType": "oauth2",
            "url": "https://hostname/api/TestConnection",
            "httpParams": {
                "password": "Snp@ssw0rd",
                "grant_type": "password",
                "scope": "useraccount",
                "client_id": "3c774f2fb7e83110cdb30652042d0ba9",
                "client_secret": "`$v9R3m7[O",
                "username": "admin"

            },
            
                "host": "host70.ca",
                "port": "443",
                "authMethod": "password"
            
            "httpHeaders": {
                "Content-Type": "application/x-www-form-urlencoded"
            },
            "authError": [
                "InvalidAuthenticationToken"],
            "httpMethod": "POST",
            "httpContentType": "application/x-www-form-urlencoded",
            "errorPath": "error.code",
            "maxRefreshTryCount": 5,
            "tokenResponsePath": "access_token",
            "tokenType": "Bearer",
            "retryFailureStatusCode": [401],
            "accessToken": "Bearer token"
        }
    }
}

"ImportAccountEntJSON": {
    "accountParams": {
        "processingType": "SequentialAndIterative",
        "connection": "OSService",
        "createUsers": false,
        "call": {
            "call1": {
                "http": {
                    "url": "https://hostname/api/getAllUsers",
                    "basicUrl": "<domain name>",
                    "hostUrl": "/api/getAllUsers",
                    "httpContentType": "application/json",
                    "httpMethod": "POST",
                    "httpHeaders": {
                        "Authorization": "${access_token}"
                    },
                    "httpParams": "{\"connectionInfo\": {\"host\": \"${connection.host}\",
                    \"port\": \"${connection.port}\",
                    \"authMethod\": \"${connection.authMethod}\"
                    },\"customFilter\": {\"attribute_name\": \"uid\", \"filter_operator\": \"notstartswith\", \"values\": [\"T\", \"@T\", \"$T\"]}

                    }"

                },
                "listField": "result",
                "keyField": "accountID",
                "colsToPropsMap": {
                    "accountID": "uid~#~char",
                    "name": "username~#~char",
                    "displayName": "username~#~char",
                    "status": "#CONST#true~#~char"
                }
            }
        }
    }
}

 


Thanks.

If you find the above response useful, Kindly Mark it as "Accept As Solution".

Lynn
New Contributor III
New Contributor III

Hello @sudeshjaiswal ,

I tried your suggestion, but still got the same issue.

Below is the screenshot of postman, postman is working fine. the issue is the variable binding for $.

Lynn_0-1701874027146.png

 

Many thanks.

Regards,

Lynn

@Lynn : Did you try single slash (\)


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

Lynn
New Contributor III
New Contributor III

\\$ is working:

Lynn_0-1701878328403.png

 

 

Regards,

Lynn

Lynn
New Contributor III
New Contributor III

Hi @sk,

Is this a bug? using postman, I don't need to specify double slash \\.

Regards,

Lynn

\\$ Should work & its expected to escape character. $ character is used by product to evaluate dynamic value in connector hence its expected and not bug.


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

@Lynn : Nope that is expected behaviour. Because system uses $ to evaluate dynamic values so to avoid that we need to give escape characters(\\)


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