Set up UI-only reference fields
Use the steps below to set up UI-only reference fields in Nintex Apps with linked objects from Salesforce, Nintex Data, or any supported data sources.
Jump to:
Goal
-
Create a UI-only model with a UI-only reference field that lets users select a record.
-
Use the selected record to filter and display details from a linked data model, such as Salesforce, Nintex Data, or any supported data source.
Step 1: Create the UI-only model
-
Click Models in the Elements panel.
-
Click Add a model.
-
Complete the following model properties:
-
Model Id: The unique name by which components refer to this model.
-
Model Description: A description of the model and the data it contains.
-
Connection: Select UI-only.
-
-
Click OK.
-
Under Data, click Create a UI-only field.
-
Complete the field properties. For more information, see Create the UI-Only field.
-
For Display type, select Reference from the dropdown.
-
In the Reference setup, complete the following properties:
-
Connector: Select a connector from the dropdown. For more information, see Connectors.
-
Connection: Select a connection from the dropdown. For more information, see Connections.
-
Object: Select the object you want to reference.
-
Related entity: key field: The name of the primary key or ID field in the related object that will be used as the key to link the data.
-
Relationship field name: The name of the UI-only field to store related information about the referenced record. (Optional)
-
-
Click Apply.
The following sample names apply to steps 1 through 3:
-
UI-only model: UiOnlyModel
-
UI-only reference field: SelectedRecord
In Step 2: Create the linked data model, the SelectedRecord field from the UI-only model is used to filter the linked model.
Step 2: Create the linked data model
-
Click Models in the Elements panel.
-
Click
.
-
Complete the following model properties:
-
Model Id: The unique name by which components refer to this model.
-
Model Description: A description of the model and the data it contains.
-
Connection: Select the same connection used in Step 1: Create the UI-only model.
-
Object: Select the same object used in Step 1: Create the UI-only model.
-
-
Click OK.
-
Add the fields you want to display. For more information, see Add fields using the models list.
-
To load data only when a record is selected at runtime, turn off the Query on page load toggle in the Properties. For more information, see Properties.
-
Add a condition to filter the model using the selected record. For example:
-
Field: Id
-
Operator: =
-
Value: UiOnlyModel.SelectedRecord
-
Enclose in quotes: Yes
-
If no value: Deactivate model
For more information, see Model Conditions.
-
Step 3: Add a model action to sync records
-
Click Models in the Elements panel.
-
Select the UI-only model added in Step 1: Create the UI-only model.
-
Click Actions.
-
Click Add action and configure a model action to update the details when the user selects a new record at runtime. For example:
-
Trigger: Row Updated
-
Field: SelectedRecord
-
Action Type: Requery Models
-
Models to Requery: LinkedModel
For more information, see Model Actions.
-
-
Click Apply.
This action keeps your linked model in sync when the selected record changes.
Step 4: Build the page with components
-
Add a Form component. For more information, see Add components to the canvas.
-
Set the Model property to the UI-only model from Step 1: Create the UI-only model. For more information, see Form.
-
Click Add fields.
-
Select the UI-only reference field from Step 1: Create the UI-only model. This gives the users a lookup at runtime to select a record.
-
Set the component's Model property to the linked model from Step 2: Create the linked data model. This will display the details of the selected record from the lookup.
-
Click Add fields.
-
Add any display fields you want.
-
Click Save.
Step 5: Test your page
-
Click Preview. For more information, see Preview a page.
-
Select a record using the lookup field. This loads the matching record into the linked model.
-
Try changing the selection and the page should update automatically.
Summary
This tutorial helps you build a dynamic page where users can:
-
Select a record using a UI-only model.
-
Filter record details from a linked model.