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

Use if else condition in ImportAccountEntJSON

krunalkadam
New Contributor III
New Contributor III

 

Hi,

We are currently undertaking a Tenable integration for a client and have encountered a challenge during the account import process. Specifically, we need to ensure that the “Administrator” String is assigned to Customproperty3 when the permissions value retrieved from the Tenable REST response is 64.

We would greatly appreciate any assistance you can provide on this matter.

Enclosed is the JSON configuration that is not functioning as expected:
{
"accountParams": {
"connection": "acctAuth",
"processingType": "SequentialAndIterative",
"call": {
"call1": {
"callOrder": 0,
"http": {
"url": "https://cloud.tenable.com/users",
"httpHeaders": {
"X-ApiKeys": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"httpMethod": "GET"
},
"listField": "users",
"keyField": "accountID",
"colsToPropsMap": {
"accountID": "uuid~#~char",
"name": "username~#~char",
"displayName": "name~#~char",
"customproperty1": "enabled~#~char",
"customproperty2": "permissions~#~char",
"customproperty3": "${permissions=='64'?'Administrator':'Basic User'}~#~char"
},
"makeProcessingStatus": false
}
}
}
}

Best Regards,

Krunal Kadam

5 REPLIES 5

Falcon
Saviynt Employee
Saviynt Employee

Disclaimer -This response is created by AI and may not be accurate. Please verify the information before use. Your feedback helps us improve.

To address the issue you're facing with the Tenable integration, particularly with assigning "Administrator" to Customproperty3 based on the permissions value being 64, the JSON configuration you've provided requires a slight adjustment. Specifically, the expression used in the colsToPropsMap for customproperty3 must be adapted for correct evaluation within the Saviynt integration context.

Your original JSON snippet for customproperty3 is:

 

"customproperty3": "${permissions=='64'?'Administrator':'Basic User'}~#~char"

 

 

 

This expression aims to check if the permissions value equals "64" and, based on that condition, assigns either "Administrator" or "Basic User" to customproperty3. However, if it's not working as expected, it's likely due to the way the expression is being interpreted within the integration environment.

To ensure proper functionality, let's revise this part of your configuration. It's important to confirm that the variable reference (in this case, permissions) matches exactly with what's provided in the Tenable API response and that the syntax for conditional expressions aligns with the Saviynt platform's parsing capabilities.

A corrected version, assuming the platform supports standard JSON and script processing, might look similar (but it's crucial to adjust based on the specific parsing and scripting rules of the Saviynt integration environment):

 

"customproperty3": "${permissions=='64'?'Administrator':'Basic User'}~#~char"

 

This expression aims to check if the permissions value equals "64" and, based on that condition, assigns either "Administrator" or "Basic User" to customproperty3. However, if it's not working as expected, it's likely due to the way the expression is being interpreted within the integration environment.

To ensure proper functionality, let's revise this part of your configuration. It's important to confirm that the variable reference (in this case, permissions) matches exactly with what's provided in the Tenable API response and that the syntax for conditional expressions aligns with the Saviynt platform's parsing capabilities.

A corrected version, assuming the platform supports standard JSON and script processing, might look similar (but it's crucial to adjust based on the specific parsing and scripting rules of the Saviynt integration environment):

 

{
  "accountParams": {
    "connection": "acctAuth",
    "processingType": "SequentialAndIterative",
    "call": {
      "call1": {
        "callOrder": 0,
        "http": {
          "url": "https://cloud.tenable.com/users",
          "httpHeaders": {
            "X-ApiKeys": "${access_token}",
            "Accept": "application/json"
          },
          "httpContentType": "application/json",
          "httpMethod": "GET"
        },
        "listField": "users",
        "keyField": "accountID",
        "colsToPropsMap": {
          "accountID": "uuid~#~char",
          "name": "username~#~char",
          "displayName": "name~#~char",
          "customproperty1": "enabled~#~char",
          "customproperty2": "permissions~#~char",
          "customproperty3": "${permissions=='64'?'Administrator':'Basic User'}~#~char"
        },
        "makeProcessingStatus": false
      }
    }
  }
}

 

If adjustments to this expression do not resolve the issue, or if the scripting and parsing capabilities are different, it might be necessary to look into the documentation or support resources for Saviynt's REST connector or the integration environment's scripting language for the correct syntax and capabilities, particularly for handling dynamic expressions and variable references.

Additionally, ensure that the response from Tenable's API is structured in a way that the permissions value is directly accessible and comparable as expected in the colsToPropsMap configuration. If the structure is nested or requires additional parsing to access, you may need to adjust the reference accordingly.

krunalkadam
New Contributor III
New Contributor III

It just copy pasted my original JSON. There is no solution provided here.

@krunalkadam Yes. I overlooked the response. Thanks for posting the corrected json.

rushikeshvartak
All-Star
All-Star
 

 {

"customproperty3": "#CONST#${response.permissions=='64'?'Administrator':'Basic User'}~#~char"
}


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

krunalkadam
New Contributor III
New Contributor III

Thank you for the help. There was a minor change in the syntax as 64 was coming as integer instead of string. Below is the latest working Format:

 {
"customproperty3": "#CONST#${response.permissions==64?'Administrator':'Basic User'}~#~char"
}