How-to get insight attribute value

One common thing is to get the value of an attribute in insight. In this example we will get an array for objects by providing a IQL and get the attribute value of each item.

https://documentation.mindville.com/display/ICV8/IQL+-+REST


Get insight data

  1. Add a new action in iHub (use the application/json template)
  2. Set method to GET with URL: {{baseUrl}}/rest/insight/1.0/iql/objects?objectSchemaId=REPLACE_WITH_SCHEMA_ID&iql=REPLACE_WITH_IQL 
    Not you can use space and = sign in the URL it will be auto converted to URL Encoded.
  3. Investigate the response, the attributes are stored in the attributes list of each object. And the IQL will return a list of objects in objectsEntries.
  4. Create a Iteration child under the GET insight data action
  5. Add the json path $.objectsEntries
    This will loop through all entries in the list of objectsEntries
  6. Create an Action under the Iteration that will use each object as input.
  7. Make sure to select Auto-generate 1st level as variables from parent response
  8. Assign the attribute to a JSON Path variabel by adding a name  and the path as shown below.
    $.attributes[?(@.objectTypeAttributeId==29944)].objectAttributeValues[0].value
    Make sure to exchange the objectTypeAttributeId 29944 to the one you want.