Inputs How-To: Activate and Set a Condition and Requery Model

The Activate & set value of model condition and Query model action types are very commonly used together. By following the directions below, you can create an action sequence that bundles the two into one action type.

Note

The instructions below assume you are working in the SkuidSample_Advertisements page, one of Skuid Central’s sample pages.

If you do not have these sample pages in your Skuid site yet, create them now:

  1. Within the Skuid UI, click the Skuid logo to navigate to Skuid Central.
  2. Click the Explore button.
  3. Edit or clone the SkuidSample_Advertisements page and follow the instructions below.

Create an action sequence

First, create an action sequence and establish its inputs.

  1. Click the fa-cogs Action Sequences pane.
  2. Click fa-plus-circle Add Action Sequence.
    • Sequence Name: Set Condition and Query model
  3. Click the Inputs tab in the Properties pane.
  4. Add each of the following inputs
    • An input for a model
      • Name: Model to Use
      • Type: Model
    • An input for a model condition
      • Name: Condition to Set
      • Type: Model Condition
    • An input for the value of the model condition.
      • Name: Value
      • Type: Value

Add Action Types

Next, add the two action types to the action sequence.

  1. Click the Actions tab.
  2. Add the specified action types with the following properties:
    • Activate & set value of model condition
      • Model: Model to Use
      • Condition: Condition to Set
      • Value: {{$Input.Value}}
    • Query model
      • Model: Model to Use
      • Query Behavior: Standard - Completely Replace Data

Use Sequence to Replace Actions

Finally, use this action sequence to replace two other actions.

  1. Click the View Product button within the page’s Button Set component.
  2. Click the Actions tab.
  3. Click fa-times-circle Remove Action on both the Activate & set value of model condition and Query model action types.
    • Leave the Show Popup action type.
  4. Click fa-plus-circle Add action.
  5. Set the action type’s properties:
    • Action Type: Run action sequence
    • Action Sequence: Set Condition and Query model
    • Model to Use: Products
    • Condition to Set: ID
    • Value: {{FeaturedProduct.ID}}
  6. Move the newly created action above the Show Popup action.
  7. Click Save.

And with that, you have created an action sequence that bundles the two action types in a way that they will always work in tandem.

Results

Preview the page and click the View Product button within it. You should see the product detail popup, just as before.

Use the concepts illustrated here to experiment and create your own action sequences, using the power of inputs to create streamlined