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:
- Within the Skuid UI, click the Skuid logo to navigate to Skuid Central.
- Click the Explore button.
- 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.
- Click the Action Sequences pane.
- Click
- Sequence Name: Set Condition and Query model
Add Action Sequence. - Click the Inputs tab in the Properties pane.
- 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
- An input for a model
Add Action Types¶
Next, add the two action types to the action sequence.
- Click the Actions tab.
- 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
- Activate & set value of model condition
Use Sequence to Replace Actions¶
Finally, use this action sequence to replace two other actions.
- Click the View Product button within the page’s Button Set component.
- Click the Actions tab.
- Click
- Leave the Show Popup action type.
Remove Action on both the Activate & set value of model condition and Query model action types. - Click Add action.
- 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}}
- Move the newly created action above the Show Popup action.
- 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