Skip to main content Skip to complementary content

InObject - chart function

The InObject() chart function evaluates whether or not the current object is contained inside another object with the ID specified in the function argument. The object can be a sheet or a visualization.

This function can be used to show the hierarchy of objects in a sheet, from the top-level sheet object to visualizations nested within other visualizations. This function can be used alongside the if and ObjectId functions to create custom navigation in your apps.

Syntax:  

InObject(id_str)

Return data type: Boolean

In Qlik Sense, the Boolean true value is represented by -1, and the false value is represented by 0.

Arguments
Argument Description
id_str A string value representing the ID of the object being evaluated.

The sheet ID can be obtained from the app URL. For visualizations, use the Developer options to identify the object ID and the text string of the object type.

  1. In analysis mode, add the following text to your URL:

    /options/developer

  2. Right-click a visualization and click Developer options icon Developer.

  3. Under Properties, obtain the object ID from the dialog header, and the object type from the "qType" property.

Limitations:  

This function can give unexpected results when invoked in an object (for example, a button) inside a container which is a master item. This limitation also applies to filter pane master items, which are containers for a number of listboxes. This is because of how master items use the object hierarchy.

InObject() is often used in combination with the following functions:

Related functions
Function Interaction
if - script and chart function The if and ObjectId functions can be used together to create conditional expressions. For example, visualizations might achieve conditional coloring through expressions using these functions.
ObjectId - chart function Similar to if, ObjectId is also used with InObject to create conditional expressions.

Example 1 – Basic functionality

Example 2 – Objects with conditional colors

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!