Skip to main content
Version: 8.1

DB Browse Bindings

Inductive University

DB Browse Binding

Watch the video

Binding Properties to Database Tables​

The DB Browse binding is technically equivalent to the SQL Query binding, except that it helps write the queries for you. Using the Database Browse binding type, you can pick the table from a list of tables in each database that you want to pull content from. If you have a fixed range of data you need to return, simply select it in the table, and watch the query get generated.

In the Browse Database tree, you can choose which columns in your table should act as your keys (these columns get put in the WHERE clause based on your selection) and which columns should be used to sort the data (these columns are put in the ORDER BY clause).

tip

This binding type also serves as a convenient jumping-off point for the more flexible SQL Query binding. Construct the basic outline of your query in the DB Browse section, and then select the SQL Query radio button to convert to the new binding type. Your query will be retained and can then be modified manually.

DB Browse Binding: Binding Properties to Database Tables

Configuring the Binding​

After selecting a table in the Browse Database tree, you can customize which columns the query is selecting by selecting one or more columns under the table to select just the highlighted columns, or selecting the table to use the * symbol to select all columns.

Key Column​

The DB Browse binding has the ability to designate key columns within the query. A key column is used within the select query's where clause, and can be given a value. A column is denoted as a key column when it has a key symbol next to it.
Clicking the Key icon to the right of the Browse Database tree will designate a column as a key column. Alternately, if the highlighted column is already a key column, then clicking the Key icon will remove that column as a key column.

Sort Order​

In the DB Browse binding, you can also sort data in ascending or descending order. Select the column that you want to sort by and click the Sort icon. Multiple columns can be used for sorting.

Dynamic Filters​

Inductive University

DB Browse Binding - Dynamic Filters

Watch the video

DB Browse bindings also give the ability to bind a property to a key column to allow for dynamic filtering of the returned data. Simply click the binding icon next to the key column field. This allows you to give the operators some control over the data they are seeing.

  1. In the designer, drag a Table component and a Text Field component on a window.

  2. With the Table component selected, click the Binding binding icon icon next to the Data property.

  3. Chose DB Browse under Binding Types > Database.

  4. Let's pull all the data from this Table except for the id, and filter on state. Remove the Key key button from the id column and place it on the state column.

    Dynamic Filters Step 3

  5. Select the Tank_Number, Lot_ID, Notes, and t_stamp columns. You can do this with Control+Click, or by clicking and dragging in the results table in the upper right.

  6. Instead of statically typing in a value like we in did in the above example, let's make it dynamic using the Text Field. Click the Insert Property Value icon next to the value in the Key Columns section, and select the Text property of the Text Field.

    Dynamic Filters Step 5

  7. Notice there is now a property reference in the Key Column as well as the Generated SELECT Query.

  8. Click OK to confirm the binding.

  9. Put the Designer into Preview mode.

  10. Enter the Lot_ID that you want to view and the Table will update to display just the data for that Lot ID.

Scalar Query Update​

Inductive University

SQL Query Binding - Scalar Query and Update

Watch the video

Similar to the SQL Query Binding, the DB Browse Binding has the ability to become bidirectional by doing a database write back when the property being bound is a non-dataset type. In this case, the select query should be configured to only return a single row from a single column.

For example, this option can provide a single value to the Text property of a Text Field component. If you check the Enable Database Writeback checkbox, then any user input will write back to the database. This will automatically generate an update query that will push the input value into the database from the location where the original value was retrieved.