In this article, you can learn about Source settings in Views and how those settings apply to which records will display.
All Views will note which records are being shown in the view editor. However, in views that display multiple records, you have the option to customize which records are displayed.
In the “Source” tab within the view's settings, you have the option to add internal filters which customize which records are shown and how they are displayed. By default, views will display every record stored from that table if no filters are applied.
The Source tab has three sections that allow you to customize which records are displayed:
- Data: Add rules to define and limit which records will display.
- Sort: Define the sort order in which records will display.
- Limit: Define how many records to show. If you want to display only a certain number of records instead of all them, you can set a limit.
For example, we may want to display our top ten Products, so we would set the limit to "10".
The Data section of the Source settings indicates which table's records the grid is displaying. Here, you can add rules which add internal filters which filter the records from that table.
These rules allow you to match specific field values to filter the records and apply these filters in groups.
For example, in a Customer Portal app for Service Requests, you may want to create a view that only shows Service Request records which are open. You can do this by adding a rule to restrict the Service Request records to those where Status = Open.
To add your first rule to a view, select "Add rules to filter records".
Rules add an internal filter to restrict which of the table's records will display in your view. This means records will only display when they match your rules, and these filters cannot be removed by users in the Live App.
There are three parts to a rule:
- Field: The field input displays the fields in the view’s table.
- Operator: The operator is how you will filter your records and is dependent on the field type. For example, Date/Time fields have options that other fields do not have, such as, “is before today”.
- Value: The values are the conditions you are matching for and are dependent on the type of field. For example, a Date/Time field with an operator of “is before” and a value of “05/05/2024”. Not all rules will need values inputted.
For example, in the Customer Portal sample app, you may also want to view only display Service Records with a Status of complete to see a past history of requests. We can add a rule to the view’s source to restrict the records to those where "Status is Complete".
When adding multiple rules, you can set how these rules will be matched. The match type determines whether records will need to match any of the rules or all of the rules. This only applies if you have more than one rule.
When using the "all" option, all rules must be met to return records. For example, you may want to create a view that displays all open Service Requests where the services needer are "Troubleshooting and Repair".
In this case, you’d need to create two rules and require an "all" match:
- One rule to match all Service Requests with a status of “Open”
- A second rule to match Service Requests with Services Needed that equals "Troubleshooting and Repair"
When using the "any" option, records matching any of the rules will be returned records. For example, you may want to create a view displaying any Service Requests that meet either of two criteria.
You can create two rules and require an "any" match to view all Service Requests with either a Service Needed set as "Troubleshooting and Repair" or Service Needed as "Software Installation":
- One rule to match Service Request with a services needed that equals "Software Installation"
- A second rule to match Service Requests with a services needed that equals "Troubleshooting and Repair"
Groups allow you to group multiple rules together with different matching. For example, perhaps you must match your first rule, and only either of your last two rules.
For example, you need to match all open Service Requests that have a Services Needed of "Troubleshooting and Repair" or "Software Installation".
In this scenario, the original match is set to all and the grouping match is set to any. This means that records will display if:
- Service Requests with a Status of “Open” AND
- At least one match from this group:
- Service Requests with a Services Needed that equals "Troubleshooting and Repair"
- Service Request with a Services Needed that equals "Software Installation"
If you switch the matching, this will match for any of the first rules and must match the grouped rules. For example, if you want to see any records with Service Needed of either "Troubleshooting and Repair" or "Software Installation" or Service Requests that are "Open" with a Service Date of today.
This means that records will display if:
- Service Requests with a Services Needed that equals "Troubleshooting and Repair" OR
- Service Request with a Services Needed that equals "Software Installation" OR
- All matches from the second group:
- Service Requests with a status of “Open”
- Service Requests with a Service Date of today
Sorting determines the order in which records will display. You can sort on most fields in two directions.
You can also add multiple sort rules if needed.
In the example below, the Service Request records are being sorted chronologically from oldest to newest:
Table sorting preferences do not apply to records displayed in a view in any manner. You can set a grid's sort order in the grid's settings in the Data section of the Builder.
Tables' sort order applies to records displayed in connection field drop downs and the tables' record view in the Data section of the Builder.
There is currently no way to sort records in a view while in the Live App other than clicking on the headers of fields and sorting by just one column.