Download PDF
Download page Query Action.
Query Action
The Query action is a point-and-click query builder. The Query action retrieves data from your environment based on predefined parameters and, if specified, user input during App runtime. You can create as many queries as needed and use them more than once across Action Flows.
You can add many filters to Query Actions that are either hard-coded or that rely on either user or spreadsheet input at runtime. These filters can also be connected using filter logic. Query actions work with Display Actions to retrieve and display records in apps.
To create a Query action
- Click on the arrow beneath the Actions button and select Query.
- Enter an Action Name. Use a descriptive name, for example, Query Opportunities.
- From the Object drop-down list, select an Object.
- Type a number in Max Records to specify the maximum number of records to be returned. Leaving it blank will return all records unless otherwise restricted by the filters below.
- Click the Enable Favorite Filters check box to enable Favorite Filters for this query action. Refer to Enabling and Using Favorite Filters in Queries for more information.
- In the default filter row, click the lookup icon and select a field from the selected object or click on an orange lookup field to navigate to a related object and select a field from there. To select a field from a lookup object, the object and field must have been selected in objects.
- Select one of the following Value Types:
- Input: This is for restricting records from the selected object based on a field from another object. It also implies that an input is required during an Action Flow. For example, retrieve all opportunities for an account that was previously selected by a user in a search and select action. X-Author Designer will automatically suggest matching fields from the related object. Select the correct field from the drop-down list.
- Static: Type a specific value to restrict which records are retrieved. For example, only get records where the Geo field equals "West". If you set the Value Type as Static, and the operator as in or not in and the query has more than 20,000 characters, the query is executed successfully during run-time. If the query condition comprises more than 20,000 characters, the query is chunked into multiple queries executed separately and the results are combined into a single query execution.
- System Variables: There are three system variables available for use.
- Current User - Used to restrict records based on the currently logged in user.
- Current Date - Used to restrict records to the current date.
- ExportRecordId - Used for Apps that are launched from your environment.
- User Input: This will generate a user input field at runtime. This option will present the field name to the user at runtime unless you change it as follows:
Hover over the field name and a pop-up will be displayed. Change the field name in the pop-up and click the green check mark. To remove a label, click the red cross mark.
If you set the Value Type as User Input, the operator as in or not in and the user input query has more than 20,000 characters, the query is executed successfully during run-time. If the query condition comprises more than 20,000 characters, the query is chunked into multiple queries executed separately and the results are assimilated as a single query execution.
Cell Reference: This will filter the query results based on the value of a cell reference provided. If you set the Value Type as Cell Reference, and the operator as in or not in and the query has more than 20,000 characters, the query is executed successfully during run-time. If the query condition comprises more than 20,000 characters, the query is chunked into multiple queries executed separately and the results are combined into a single query execution.
The Cell Reference Value Type is not supported in Presto Apps.
Select an Operator. The following table describes combinations of field types, value types, and operators (click to enlarge).
Formula field types are also supported. The corresponding supported operator types depend on the the datatype the formula field returns. The supported return types for formula fields are boolean, double, string, currency, percent, date and email.
- Click Add Row to create more filter conditions.
- Click Save.
Filter Logic
X-Author uses the same filter logic method as your environment.
Example: For the defined filters, find records that match both the first two filters or the third. Enter filter logic as (1 AND 2) OR 3, or 3 OR (1 AND 2).
Important
In Microsoft Dynamics, define filter logic within brackets. Example: (1 OR 2), ((1 AND 2) OR 3), ((1 OR 2) AND 3)Find records, where the amount is greater than “$10 million” AND the close date, is earlier than “03/19/2016” OR any opportunity where stage equals “Qualification".
Amount > 10000000, Close Data < 03/19/2016, Stage = 'Qualification'
Using Filter Logic at Runtime
When a query defined as User Input includes a picklist field as one of the criteria, you can see a preview of the values in the list.
To specify a value for the query, click the ellipsis button next to a field to see additional picklist values.
When you click the ellipsis button a pop-up appears.
- Add one or many values to the Selected Values area using the right arrow.
- Quick Search is a wildcard search that automatically filters down the list of available values in the list below.
- The values moved to the right under the Selected Values area are selected for In or Not in"operator processing.
- After the user selects a list of values and clicks on Save, the window closes and the text on the Runtime screen shows the values separated by a comma in the textbox.