Getting Started with Queries
Note: Some features are in technical preview, and may not be available to all users. For more information, contact your Laserfiche service provider.
Queries allow you to perform queries on lookup tables or external data sources. There are two forms of the query editor. The basic editor includes a set of boxes that allow you to build SQL-like expressions to extract information from data sources. The custom editor allows advanced users to write custom SQL queries and scripts using all of the SQL language. Refer to this page for security tips when using the custom SQL editor.
To create a new query:
- On the Rules page, select the arrow beside New and select Query as your rule type.
- In the Create Query Rule dialog, specify the Name and Description for your rule.
- Select whether you want to query a lookup table or a data source.
- If you choose to query a data source, specify the external data source that you want to query.
- Choose whether to build a Select, Insert, Update, Custom, or Delete query type.
Note: Delete is only available for the Lookup Table query type, and Custom is only available on the external data source type.
- Click Create.
To build a query using the basic editor:
- Build the query statement using the following sections of the query editor unless a Custom query type was selected:
- FROM: Specify the table you want to query.
- SELECT: Pick the columns from the table.
- WHERE: Pick individual values in a column.
- ORDER BY: Indicate the order of the query results.
- GROUP BY: Organize the data in a column.
- Configure the Rows to Return field with the desired number of rows for the query to return. Returning only the amount of rows necessary for your process can increase performance.
- Use the Test button to ensure that the query works as you expect.
- Add the query to your processes.
Note: If the Rows to Return field is not configured, it will default to 100 rows for new rules and 10,000 rows for previously created rules
Using the Custom query editor:
- Write your SQL statements in the Query window or copy and paste from another query editor.
- Use the Insert Token button to create input parameters that can be populated at run time.
- Use the Test button to ensure that the query works as you expect.
Alternatively, you can import a query from a .bri file. After import, double-click on the rule to open the rule editor.
For an example that uses this feature across process automation, see the Migrating Laserfiche Form Tables into Microsoft Word Documents whitepaper.