This article offers a comprehensive overview of Knack's search views, providing valuable insights into the available settings and options.
This article covers the following topics:
What are search views?
A search view is a component in your Live App that allows you to search and display multiple records from your app.
A search view in your app showcases records from a single table. You have the flexibility to choose any fields from that table to display as columns in your search view.
The search results can be presented in either a grid or list view format.
What do search views look like in the Live App?
Here, you will find a search view displaying Invoice records in the Live App:
Note: When performing searches using multiple fields, it is important to note that the results will only include records that meet all of your specified criteria.
Adding, editing, and deleting views are managed the same regardless of view type. To learn how to add, edit, and delete search views from your app, see our article: About Views.
To edit and access the settings of a report view, hover your mouse over the view and click on the pen icon that appears at the top left of the view. This will open the search view settings in the toolbox to the left.
This section will display four settings sections:
Source: Specify the records to be searched.
Settings: General view options and settings.
Search Inputs: Specify the search fields available to users in the Live App.
Search Results: Define how the search results will appear.
The Source section in the view settings provides information about the records used in the view. For instance, it may indicate, "This search displays Project records." This section also allows you to apply internal filters, sort the records, and limit the number of records displayed.
Within the source section, you have the ability to:
View which records are being displayed by the view.
Add filters to restrict what records are displayed in the search results.
Define the default sort order of records in the search results.
Set limits for the number of records that are displayed in the search results.
Tip: To learn more about the data source, see our article here.
The Settings section is where you will discover the general options and settings for your search view.
In the Settings section, we will discuss the following options in the order they appear from top to bottom:
Grid Design (only applies if you have selected to display search results in a grid)
Show results to start: By default, when conducting a search, no results will be displayed initially, and only the search fields will be visible. If you want to show an initial page of records, you can check this option.
Hide fields that don’t have values: Exclude fields with no values from the search results.
Allow record exporting: The exporting feature enables users to export all the data from the grid into a different format. A link for exporting will be displayed in the top left corner of the view's results, providing options for downloading the data in CSV, TXT, or JSON format.
Inline editing: Users have the ability to edit individual field values directly in the view by simply clicking on the grid cell. This action will open a popup modal where the field value can be conveniently edited.
This option is available only when you have the search results set to display in a grid.
Note: Exported data will always accurately reflect the data displayed in the grid, including any sorting and filters applied.
Empty Results Text
Customize the Empty Results Text to show a personalized message when the search submitted by the Live App user does not yield any results. This message will appear in the Live App under the search inputs.
Column summaries provide a concise overview of each column at the bottom of the search results grid.
Note: Column Summaries are not available when the search results are set to display in a list.
These summaries allow you to perform calculations on all the rows in the column within the search results grid. The results are then displayed as a summary at the bottom of the grid columns.
In the search view settings, you can easily add column summaries by clicking the "Add Summary" button. You can choose from four different summary types: Sum, Average, Minimum, and Maximum.
To add a column summary, simply provide a title for the summary and select the desired summary type. By default, the title is set as "Total".
If you would like to add more than one summary to your search view, you can select the plus icon to add additional summaries. The "x" icon is also available if you would like to remove summaries from the view:
This is an example of how column summaries are displayed at the bottom of the view in the Live App:
Pagination controls the number of records displayed at a time. If the total number of records exceeds the set limit, additional pages with links will be added to the search results grid, allowing users to navigate and view more records.
Within the Pagination section, you have the ability to customize your search view with four different options:
Set how many records (10, 25, 50, or 100) to view at a time
Let the user change the amount: This feature enables users in the Live App to customize the number of records they view per page.
Repeat pagination controls below the view: By enabling this option, pagination controls will be displayed both at the top and bottom of the list. The default display will show the current page number and the total number of pages.
Note: If the feature to allow users to customize the number of records per page is enabled, this option will also appear at the bottom of the view in the Live App.
Title and Description
This section allows you to add a Title and Description to your search view. Here is an example of what a search view looks like with no title or description:
This is an example of how a search view appears when it includes a title and description:
If you have selected to display search results in a grid, you will be able to toggle the Grid Design option. This setting overrides the global grid design settings found in the App Settings and allows you to customize the format, row striping, row hover, and row spacing for the particular view.
The following options are available in the section:
Format: This setting provides you with the option to choose between a sleek appearance or include borders to your grid columns.
Row Striping: With this option, you can use alternate background colors for grid rows.
Row Hover: Enabling this option will highlight rows when users hover over them.
Row Spacing: You have the options to select between cozy, default, and spacious for spacing in-between the grid rows.
Adding Search Inputs
In the Search Inputs section of the search settings, you have the ability to add fields to your view and you can format your labels for your fields here. The fields serve as the search input fields that users can utilize to refine and narrow down their search results.
These fields can include any fields from the source table of the view, connection fields, and keyword search and static elements for organization:
You have the ability to add all of the source/connected table's fields to the view, or you can create new fields as highlighted below:
You can easily add additional fields from the list by clicking on them to automatically apply the field to the view or by dragging and dropping the fields to your desired position:
Editing Search Inputs
To modify fields in a search view, simply hover over the field and click on the pen icon. This action will update the left side menu to display the Input Properties to edit each search input:
Field: This is the field's name that was applied in the Data section of the Builder when creating the field. This field name can only be edited from the field's settings.
Label: The text that appears before the search input, identifying the field.
Advanced Filters: When the checkbox is not selected, the field will have a basic input for searching. If the checkbox is selected, advanced filters can be applied to refine the search for that field.
Required: If checked, a value must be entered for this search field in order to submit the search.
Default: You have the option to set a default value that will be shown in the field input. There are a variety of operators available here depending on the field's type.
Instructions: Here, you can include instructional text if you would like to provide additional context or instructions for searching on that field. This text will be displayed in a smaller font below the search field.
Tip: Take some time to explore the field settings for each of the fields in your view. You'll be pleasantly surprised by the variety of settings available, tailored to each field type.
When editing a search input, you have the option to allow users to choose from different filter options. The options available are different operators depending on the field's type.
For example, a date/time field will allow the following operators shown below:
If the Advanced Filters option is unchecked, the following options will appear in the Input Properties:
- Search By: This option allows users to choose between selecting only one option from the dropdown in the search input or selecting multiple options.
- Input Format: Here, you can select between a searchable dropdown for the search input or radio buttons.
To remove search inputs or other elements from a search view, simply hover over the field and select the trash can icon.
Note: Removing a field here from your view does not delete the field from your database.
The keyword search is a unique feature that allows you to search through every field in the entire record, unlike the individual search inputs that only search data within their designated field.
In the Input Properties for keyword searches, you have the following options:
Label: This input allows you to modify the text shown for the keyword search.
Which fields can be searched?: You have the option to select between the fields being used in the view or all available fields in the data source table.
Required: Enabling this option will make it mandatory for Live App users to provide a value in order to search for records.
Instructions: This option allows you to input text that will be displayed below the label.
For keyword searches, please note that the search term must be at least two characters long and should not contain any special characters. Here are some other notes to consider about keyword searches:
When using the "is" and "is not" filters, the search will return any record that matches the exact word. For example, if you search for
is apples, it will return records with the word "apples" or "oranges and apples", but not "orangeapples" or "apples123".
Similarly, a search for "IS oranges and apples" will only return records with the exact phrase "oranges and apples".
On the other hand, the "contains" and "does not contain" filters will return records with partial matches within the entire string being searched. For instance, a search for
contains "apples"will return records with "apples", "oranges and apples", "orangeapples", and "apples123".
Please note that searching for email addresses is currently an exception and does not follow the "is" filters.
By default, search views include a keyword search. If you need to add one after it was removed, simply select the "Keyword Search" option under "Search":
Static elements refer to elements that are consistently displayed in a permanent manner.
Static Elements available:
Title/Copy: Set a title or copy for your view in the Live App.
Divider: Add dividers between fields in the view.
You have the ability to apply either of these static elements in various areas of the search view as shown below:
Building Search Results
The display format of the search results is determined by the search results settings of the view. By default, it is set to a grid format, but it can also be customized to appear in a list format.
The search results are divided into three sections:
Fields: You have the option to include fields from the source table as fields in your search view's list or grid search results.
Connections: Fields from connected tables can also be included as field columns in your search results.
Actions: Additional links can be added to your grid or list. These links allow you to navigate to different pages such as the details view, edit form, or another page in your app.
You can also include action links to trigger actions in your search results here. To find out more about using action links, see our article here.
To optimize performance, searches on connection fields are currently limited to 10,000 records. If a connected table has more records than this, the search results may be inconsistent. However, you can use data source filters to narrow down the search criteria and stay within the 10,000 record limit.
- Non-Latin characters are not supported.