Using the Expression Builder
The Expression Builder is a visual assistant located throughout Coghead that will help you build complicated expressions in your applications. By selecting options from the builder you will be able to generate the following logic:
- Operators for arithmetic and compare.
- Xpath Functions for string compares, date calculations, etc.
- Fields that are within the collection and remote Fields that belong to other linked collection tabs.
- Date, Time and Duration formats to be used in expressions.
- If-then-else conditions.
The Expression Builder is available in the following areas of Coghead:
Form Editor -> Calculated Field
For many of the widgets in the form editor there is a button in the Properties section of the form editor allowing you to set a field to be Simple or Calculated. If you select the Calculated radio button the Expression Builder will appear allowing you to choose Operations, Functions, Fields or Date/Time/Duration values. You can also define advanced if-then-else logic under the Operations menu.
Form Editor -> Aggregate Field
For the Input Box widget in the form editor there is a button in the Properties section of the form editor allowing you to set a field to be Simple, Calculated or Aggregate. If you select the Aggregate radio button the Expression Builder will appear allowing you to choose Operations, Functions, Fields or Date/Time/Duration values.
Form Editor -> Conditional Style
Authors can set advanced conditions which will allow a field to be visible or editable using the Expression Builder in the Conditional Style Dialog window. The Expression Builder can be accessed in the Condition text box for each constraint added.
Search -> Filter and Sort
The Expression Builder can be combined with Regular Expressions to set advanced filtering criteria in views, perform advanced searches, link widgets, lookup combo box widgets, lookup list box widgets, linked grid widgets, and the retrieve record step in an action. The Expression Builder can be opened in by clicking on the button to the right of the filtering criteria or through the Advanced QBE Filtering option.
Search -> Advanced QBE Filtering
The Expression Builder can be combined with Regular Expressions to define advanced searches in the Advanced QBE Filtering window. The Advanced QBE Filtering window allows you to visually set criteria in a replication of the collection's form. The Expression Builder can also be used to define an expression in the Condition box.
Action Editor -> Set Value Step
You can create an Action that transfers a field's value to another field or perform calculations and then update the field's value through the Expression Builder in a Set Value action step. The Expression Builder appears below the set value's output by the Value text box which is associated with the highlighted data field.
Action Editor -> Script Step
The Script Step allows you to create unique action steps using Xquery. The Expression Builder appears in the script portion of this action step.
Action Editor -> Alert User Step
The Alert User step allows you to send customizable emails to users. The Expression Editor can be used in the Email To and URL sections by clicking on the Field button or to create the Subject or Body of the email.
Action Editor -> Branch Step
The Branch Step in the action editor allows you to create if-else logic within the action. The condition which will determine the path the action process will take can be built using the Expression Builder.
Action Editor -> Loop Step
The Loop Step allows you to repeat a set of action steps as long as a certain condition is met. The 'while condition' can be defined using the Expression Builder.
Action Editor -> Exit Step
An Exit Step can be used to exit a loop or the action entirely. If the exit step quits the action you can define a message that will be displayed to the user. The Expression Builder can be used to dynamically populate the message with field names or values.
The pages below contain descriptions on all of the operations and functions that can be used in the Expression Builder. While choosing a function with the Expression builder, a description of what the function does and how it can be used will appear in a yellow popup while the mouse cursor is over the function's name.