Skip to content

Writing a Select String Statement

The Select String is used to query a data table to check for a condition. If the query returns one or more records that is evaluated to be true, the business rule will fire down that branch in the IfElse activity. If the query evaluates a record as false, it will continue through the branches of the IfElse activity.

Writing a Select String statement is crucial to proper functionality of the IfElse business rule. Select String statements use a language that is an "expression" of a .NET DataColumn.

To write a Select String statement correctly, you need to know three important things:

  • Proper syntax of a Select String statement
  • The database name of the field in the snap-in you are monitoring
  • The database name of the value of the field you are monitoring

Proper Select String Syntax

While Select String statements will vary depending upon what you wish to accomplish with your business rule, they will always have three common elements:

  • The database name of the field in the snap-in you are monitoring
  • An operand
  • The database name of the value of the field

For example, if you were monitoring the Case Type field in the Case Information snap-in and wanted to know when the value of CaseType was set to Misdemeanor, your Select String would look like the following:

CaseType = 'M'

For more information on writing Select String statements, visit the Microsoft Developers Center.

Finding the Database Name of a Field

Writing a Select String statement requires that you use the name of the field that the database uses. The database names are not always the same as the field names in JustWare, so it is necessary that you find the exact database name before proceeding.

  1. In the Activity Configuration snap-in, define the name of the snap-in that contains the field you are looking for.

    A two-column drop-down menu will appear that tells you the snap-in name and the corresponding database view of that snap-in. You will use the view name to find the database name of the field in SQL Server. 2. Open SQL Server Management Studio. 3. Expand the menu of the correct JustWare database. 4. Expand the Views menu. 5. Navigate to the correct database view of your snap-in, and expand that menu. 6. Expand the Columns menu. A list of fields in the snap-in will appear. 7. Find the field you are looking for in the list. You now know the exact database name of your field.

Finding the Database Name of a Value of a Field

Similar to fields, values in a snap-in have a specific code that must be used in the Select String statement. This code can be found in the Code Tables.

  1. Go to Admin | General Configuration | Code Tables.
  2. Navigate to the correct code table of the snap-in that contains the field and value you are looking for.
  3. Locate the field you are looking for in the code tables, and search for the value you are looking for. The code of the value appears in the left-most column of the code table.

Related Topics