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.

Run action sequence

Used to select a reusable action sequence to run within the current set of actions.

  • Action sequence: The action sequence to run.
  • Description: The description entered within the chosen action sequence’s properties.

Note

In addition to the Action Sequence property, any inputs that have been specified on the reusable action sequence are displayed as properties. For more information, see Inputs.

Warning

Use action sequences thoughtfully. If there are actions within an action sequence that are contingent on context, recognize that the context changes depending upon where and how the sequence is invoked.

When invoking an action sequence, be sure to examine the individual actions for properties and merge syntax that rely on context, and ensure that you are using the correct model conditions for that action to work within the context requirements.

Run a JavaScript snippet

Like Skuid Javascript snippets? Use a snippet alongside other actions without adding more code to the existing snippet.

  • Name of snippet to run: The exact name of the snippet.

Snippets must be registered using skuid.snippet.registerSnippet(snippetName, snippetFunction).

Publish event

Use the Action Framework to publish events. Subscribe to these events using an event-triggered action sequence or with the skuid.events.subscribe() API.

  • Event name: The name of the event to be published.
  • Publishing scope: Determines how “far” outside the current page that the published event will reach.
    • All active pages and Lightning Components: (Skuid on Salesforce only) The event will be published on all Skuid pages and all Lightning components active on the current Lightning page.
    • All active pages: The event will be published on all Skuid pages that are active in the current window.
    • Only this page (default): The event will only be published on the current Skuid page.
  • Channel (optional): Determines on which “channel” an event is published, providing another option to narrow the scope of an event. An event subscription only activates if it is also pointed to the channel specified here, even if the event name is the same.

Branch

This action 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.

  • Formula context model (optional): Establish context for the formula by selecting the model being referred to with merge syntax.

  • Branch 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"
  • 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

  1. Create a new action and select Branch as the action, then edit the branch properties.

  2. Add actions to the branch:

    • To add true actions to the branch, click add 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 proceeds with any actions listed after the branch.

    • To add actions that occur if the branch’s logic is not true, click add Add action (at the top level) and place those actions after the branch action.