Models
Models are used to display content in the layout
Typically used for record creation or editing, as well as various types of messaging
A Model needs to be added when you perform any action in an event
There are 2 types of Model
Single Record Model:
The single record Model is generally used when only a single record needs to be displayed at a time
e.g. Single record Model is used in the Form component
Multi record Model:
The multi-record Model is used when multiple records need to be displayed at a time
e.g. Multi record Model is used in the Table component
Model Creation
Create a Multirecord model
Go to the Model tab in the layout designer
Click on the + icon
Enter information, click Save
Click Details tab
Detail Tab
Label: The label is used to identify the Model at the UI
Name: Name is the unique identifier of the Model
Type: Display the Model's type
There are five types that are Record, API, Aggregate, and Item
Select the type from the dropdown menu
Record Count: Record count indicate which record should be created
There are two types of records, Single record, and Multirecord
Select the record count from the dropdown menu
Is Shared?:
Object Def: You can bind the object with the model
The complete list of objects in your instance is displayed
Select the object from the dropdown menu
Offset: You can set the offset for the query on the object. If the offset is “n“ then the query will take the records “n+1” onwards
e.g. Set Offset: 0, then the query will take the record 1 onwards
Limit: Set the limit for how many records you want to display at a time
Order By: You can set the order by on the fields to records to be queried and displayed in the Model
Click on the + icon
Fill in the information, click Save
Field name: All field names will display which is present in the object
Select the field name from the dropdown menu
Sort As: Arranging the data in a particular format
There are two types of sorting
Ascending: Elements are arranged from lowest to the highest value
Descending: Elements are arranged from highest to the lowest value
Select the option from the dropdown menu
Click Fields tab
Select the field. These fields are added to the selected fields
These selected fields are added to the model
Click the UI Fields tab
Click New button
Enter information, click Save
Label: Label for the fields
Name: Name is a unique identifier for the field
Merge text: You can merge messages by using their source type
Click on the Config icon
Enter information, click Save
Field Source:
Select the field source from the dropdown menu
Field: The object that adds to the model, those fields are displayed in the field attribute
Select the fields from the dropdown menu
Variable: Variables are containers for storing data values in PWR Apps
There are different types of variables such as Integer, Double, Date, Time, etc.
Select the variable from the dropdown menu
Model: The model you created will be displayed
Select the model from the dropdown menu
Static: You can enter any (hardcoded) value
e.g. Static: Test
Cookie: A cookie is a piece of data, that is stored within a web browser
If you have stored some value in cookies like SID, so you can get it from cookies
e.g. Cookie: Name - Record, Value - 12345
LocalStorage: Local storage is a piece of data, that is stored within a web browser
If you have stored some value in local storage like data, so you can get it from storage
e. g. LocalStorage: Key - isAdmin, Value - true
QueryParam: Query parameters are a defined set of parameters attached to the end of a URL
e.g. QueryParam: www.test.com?Name
User: The fields that are present in a user's profile that will be displayed
Select the field from the dropdown menu such as First Name, Last Name, Name, Phone, Email, Is Active, Id, Session Id
Static Value:
Merge Field Expression: A field is formed during the expression and many expressions are created by using a merge field
An expression is added to the message body by clicking the + icon
Message Body: In the merge, field expression will be displayed in the message body
Click the Criteria tab
Click on the Filter + icon
Filter: Filter criteria allow you to compare records from one object to records from another
Enter information, click Save
Field Name: Names of fields that are present in the object
You can add criteria to that field
Select the field name from the dropdown menu
Operator: The operator is a character that represents a specific mathematical or logical action
Select the operator from the dropdown menu
Equals: Used to compare two values
NotEquals: Checks whether two values are not equal
Start with: Checks any string that starts with
Contains: Indicates a search for any of the specified words within a particular attribute
EndsWith: String ends with the specified value
In: Allows you to easily test if an expression matches any value in a list of values
Source Type:
Select the source type from the dropdown menu
Such as Field, Variable, Model, Static, Cookie, LocalStorage, QueryParam, User
Name:
Enter any static value
Click Save
Return to the layout page
A Model is created
Model Addition
Select a Multi Record Model
In the basic config, Click + icon
Add the Model and click Save
For a single record model, the same procedure is used
Context Models
A Context model is created by using a multi-record model
Models Creation
Click on the + icon
Enter information, click Save
Criteria: Criteria determine the conditions under which the criteria apply
When the given criteria in the form are completed, then the criteria are fired
Using source types, you can add criteria in the form
Click on the + icon to add criteria
Add Criteria, click Save
//Source Type
On which destination do you want to compare your criteria
There are multiple source types available
Static: You can enter any (hardcoded) value
Input:
Variable: Variables are containers for storing data values in PWR Apps
Click + icon
Create Variable, click Save
Label: To display as a label for the field
Name: To uniquely identify the field within the form
Field Type: You can select the field type from the dropdown
Field: Text, Checkbox, Integer, Double, etc.
Required: If this checkbox is checked, the field is required
Is Array: If this checkbox is checked, the field is stored in the array
Default Value: You can set a default value for the variable
Variable Scope: A variable's scope determines where in a form a variable is available for use
The variable scope comes in 3 types
In:
Out:
In/Out:
Cookie: A cookie is a piece of data, that is stored within a web browser
Context: