Filter by Related Objects

A Nintex Apps model pulls in data from one primary data object located in one external system. Most filters work on the fields that are directly pulled from the object. But it's also possible to filter on data from parent or child objects included in the model.

Parent and child objects

In many databases, objects/entities can have relationships, sometimes referred to as master-detail relationships (in Salesforce, for example) or parent-child relationships (in Nintex Apps ). For example, if using the Salesforce connection:

  • A Case object is associated with the Accounts object because any Case would stem from an active account. Cases is the child of the parent object, Accounts.
  • Similarly, the Account object is associated with the Contacts and Opportunities objects: the company surfaced as an opportunity; contacts were logged and deals negotiated; upon signing a deal, the lead converted to an account. So all three objects are linked by common data. Accounts is the parent object of Contacts and Opportunities.

Filtering on a related parent object from a child object can generally be performed using automatic filters. However, filtering on a related child object from a parent calls for a slightly different strategy.

The following is a step-by-step example of creating a filter on one object that uses a filtering field from a related child object. The result is a filter that narrows the list of accounts by the associated location of the account's contacts (the state listed in the contact's mailing or billing address).

In this situation, the account object is the parent; it can exist without any associated child objects, or it can have one (or many) children. The contacts object, on the other hand, is the child of that parent: in a business environment, there is no reason to keep track of contacts unless they are somehow linked to accounts.

Assumptions

Note: 

The example below assumes a Nintex Apps page with:

  • a functioning model on an object that collects data about accounts ( here, the Salesforce Account object )

    • This object has a relationship with an object that stores data about the contacts for those accounts (for example, the Salesforce Contacts object)
  • a Table component on that model with fields for:

    • Account Name
    • Account Description
    • and a few other fields

If using a different connection, the field names indicated may be different.

The result

The Table component lists all accounts on page load. However, when the filter is activated, the filters narrows the Table's data to show only the accounts that have contacts ( the condition on the parent model ) and from that list, further narrows to those accounts that have at least one contact with a mailing address in the selected state ( the sub-condition on the parent model ).

Troubleshooting