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
- Add a new action in iHub (use the application/json template)
- 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. - 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.
- Create a Iteration child under the GET insight data action
- Add the json path $.objectsEntries
This will loop through all entries in the list of objectsEntries - Create an Action under the Iteration that will use each object as input.
- Make sure to select Auto-generate 1st level as variables from parent response
- 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.