Logic Actions¶
The solitary action in this group supports conditional branches, separate branches of actions within a single action script, based on a formula (“If this is true, then do this; if not, do that”). All this is performed within the Action Framework, without using JavaScript snippets with If/Else statements.
Branch¶
Used to create conditional branches within Action Framework scripts.
Formula: In this field, use merge syntax as well as Skuid’s formula functions to dictate the logic of the branch. Some examples:
- For toggleable fields that result in a boolean value:
- {{FieldName}} == true
- To compare fields to values, encase the values in quotation marks:
- {{ABC}} == “123”
- For toggleable fields that result in a boolean value:
Formula Context Model (optional): Establish context for the formula by selecting the model being referred to with merge syntax.
Description: Useful for Skuid administrators, the text entered in this field displays beside the word “Branch” in the Actions list.
After running the branch: Determines what happens after this branch action is complete. This property only applies to the branch if the formula evaluates as true.
- Do not run any additional actions: Do not run any additional actions from the actions list after this branch completes.
- Continue with next action: Move on to the next action (or branch) in the actions list after this branch completes.
Note
If nesting branches within branches, then be aware that the property of Do not run any additional actions on a branch within a branch will stop all additional actions, even if the top-level branch was set to continue.
Using branch actions¶
Create a new action and select Branch as the action, then edit the branch properties.
Add actions to the branch:
To add true actions to the branch, click
Add If-True Action on the branch and format the action. With conditional branching, the actions Skuid performs depend on if the branch’s logic is true:If the formula is true, then the If-True actions connected to this branch occur.
- If the branch is set to Do not run any additional actions, then Skuid ignores any actions listed after the branch action.
- If the branch is set to Continue with the next action, then Skuid proceeds with any actions listed after the branch.
If the formula is false, Skuid skips the branch—and all actions listed within it—and proceed with any actions listed after the branch.
To add actions that occur if the branch’s logic is not true, click
Add Action (at the top level) and place those actions after the branch action.