This shows you the differences between two versions of the page.

Link to this comparison view

action type - switch [2016/06/08 16:55]
action type - switch [2016/09/14 14:19] (current)
Line 1: Line 1:
 +====== Switch ======
 +This evaluation will pass if a value from the [[Expression Builder|expression]] matches one of the values defined in the cases. ​
 +===== Explanation =====
 +Switches have many [[Automation Trigger|automation triggers]] associated with them for each case defined. ​ Actions under the "​case"​ automation trigger execute when the value from the switch matches the value from the case, and actions under the "​Default"​ automation execute when none of the cases match.
 +Example : Suppose an application has several possible values for a status field and you want to run different actions when the field has the different statues. ​ While these checks could be processed with a series of [[Action Type - Compare Strings|Compare Two Text Strings]] actions it would be easier to configure and faster to process when defined as a switch that reads the status field once and runs the comparisons for each status until it finds one.
 +===== Settings =====
 +==== Value to Compare ====
 +Use the expression builder to define the value to compare.
 +==== Cases =====
 +Use the expression to define a value that will be compared to the switch value. A description for the case can optionally be defined that will be displayed in the action tree. The order determines what order the cases will be evaluated in.  Additional efficiency can be gained by evaluating the more common cases first so the action does not have to process more cases then needed.
 +==== Describe this action ====
 +Useful as a comment, this description will overwrite the automatically generated description in the [[Action Manager|Action Manager]].
 +==== Queue this action and children ====
 +When an action is [[Action Queue|queued]],​ the subsequent actions continue to process without it. Meanwhile, the queued action and its children process separately. Queue actions that you don't want a user to wait for.
Copyright WorkXpress, 2018