Note: Nintex Apps data centers are located in West US and Australia (AUS). In-region processing of Nintex Apps data is only available in these regions.

Create and Configure Models

Models are powerful tools that provide connections to external systems, allowing the builder to pull data into the page. However, models follow rules that govern how they can be connected to data objects or entities. It's important to follow these rules when creating models:

  • You can connect any individual model to only one object . For example, a model can be connected to the Account object in Salesforce.
  • You can create one—or more—models for each page, and each model can connect to entirely different objects.
  • You can connect to the same object using multiple models—allowing you to display different records with conditions on the same page. For example:
    • You may have one model on an account object that retrieves only some information about accounts, and displays the data in a Table at page load.
    • You may have another model pull in specific internal account information (such as the account owner ID, last time modified, modified by whom, etc.). Components in a "More about the Account" modal use this modal, which only displays when the user chooses to open it. Because this model doesn't load with the page, this streamlines the initial page load.

Create a Model

Customize a Model

Customize how the model behaves by using model properties, fields, conditions, and actions.

  • Model properties control essential model behaviors, like which object to query.
  • Fields specify which record attributes are available in the model.
  • Model conditions limit or filter the specific records that are pulled into the model.
  • Model actions trigger action flows that run automatically when model-level events occurs.

Note:  Depending upon the choices made, these options may impact page load times and performance.

Adjust the properties

Model properties —found in the Properties panel—determine the model's behaviors. Properties that are available vary by connector. To learn about the properties available for a specific connector, locate that connector's topic in the Connector section.

Model fields

Each model is connected to an external system—and specifically, to a particular object in that external system. Most external connections include fields that are accessible to the model. By selecting which of those available fields to add to the model, you specify the data or content to be included and avoid including extraneous data or content that you don't need.

There are several ways to add fields to a model.

Manage models

Dependent and principal models

Models can only go one “layer” deep within a response returned by a connection to provide rows to components. But by using another model—a dependent model—nested array data can be accessed as rows.

A dependent model is used to access data within array fields and child relationships on the object of a principal model. The principal model is the model containing the array or relationship a dependent model is made from. Dependent models appear nested in a tree-like visual beneath their principal model in the Models tab.

A dependent model may also be the principal model for a further nested dependent model. The maximum dependent model "depth," the amount of nested data that can be accessed, varies by connector.

Consider this example response detailing an account record, with contacts provided as an array field on that account:

Copy
{
                    "name": "Example business"
                    "industry": "Technology"
                    "contacts": [
                        {
                            "name": "Alan",
                            "preferredComms": "email"
                        },
                        {
                            "name": "Alice",
                            "preferredComms": "phone"
                        },
                        ]
                    }
 

A typical model could only access the name and industry fields shown above. But by creating a dependent model on the contacts array, the additional records can be used within the page.

Dependent models can be used much like any other model—with data, condition, and model action options all available. However, these models are “dependent” on the data within the principal model, only retrieving rows from arrays within the principal. This is because dependent models rely on the network requests of the principal model, so using them does not require additional network traffic.

Because of this, dependent models cannot be queried independently of their principal models. Anytime a principal model is queried, it updates the available rows within the dependent model. In the same way, If you require only certain data from the dependent model appear, consider using conditions.

Context and dependent models

Because dependent models are used to retrieve related details about a particular record, they're often used within context containers with context conditions. This allows the mapping of a unique identifier (typically a field like Id) on the dependent model's rows to a principal model row, ensuring the proper related details are displayed.

To learn more about context containers, see Context .

Manage dependent models

To create dependent models:

  1. Click the model containing the array or child relationship.

  2. Click the Data tab.

  3. Click Fields.

  4. Click Arrays.

  5. Beside the array you wish to include, click Create dependent model.

  • If the dependent model is attached to an array of objects, then that object's keys are represented as fields.

  • If the dependent model is attached to an array of other data types (like strings), then a field named “Field” is automatically generated, with the array’s values used as the value for that field.

  • The $Parent reference field points back to the parent record in the principal model, providing a way to display information about the parent record within a component attached to the dependent model.

Once created, dependent models can be edited and deleted like any other model.

Best Practices

  • When creating models, consider both the data users need to access and the experience you want to offer those users.

  • Model order matters: Models load in the order they're arranged in the models list: models at the top of the list load first. When a model is dependent on another for data, ensure that dependent model loads after the primary model. If necessary, re-order the models.

  • If much data is needed from a particular object, consider creating different copies of the model for particular components or usage on the page.

  • Set a Max # of records to a smaller number: Generally, users only really need to see around 10 records at a time; more records may present too much information to process, and in many cases they can load more records using pagination options.

  • Uncheck "Query on page load" to load models only when needed. Unchecking this property allows components and user action to determine when model data is loaded. This prevents all of the page's models from loading at the same time during the initial page load, which is especially valuable for pages with numerous models.

  • Don't specify Fields to order records by. If you need to use this feature, only specify indexed fields. Ordering by a non-indexed field will make the page run slower.

    Note:  Some databases support the creation of indexes for fields. To determine if the database you are using supports field indexing, see the database's documentation.

Properties

Model properties

Important: 
  • Not all model properties listed below will be available for all connectors. If you do not see a property listed here in the Page Designer, it may not be available for your connector.

Models for some connectors may have unique properties not documented here. These properties are detailed in the topics for those respective connectors.