7. Maker Course - Add Conditions to Action Blocks
Video Walkthrough
Follow Along:
Add Update Field Action Blocks and Add Block Conditions
In the module builder, locate the Intake Submitted block and select the add block button,
, beside it. The Action Block panel displays.
In the Action Block panel, scroll down to the Workflow section and select the Update Field action. The Update Field panel displays.
Rename the action to "Out of Stock".
Repeat steps #1-2 above, adding another Update Field action, then rename the action "In Stock".
On the Out of Stock action block, select the Conditions button,
. The action Conditions panel displays.
On the Conditions panel, select Add Condition. A new conditions group displays.
Configure the condition group to activate the action block when Maestro Plush Data Source Entity Id - In Stock is Equal to "FALSE".
On the In Stock action block, select the Conditions button,
. The action Conditions panel displays.
On the Conditions panel, select Add Condition. A new conditions group displays.
Configure the condition group to activate the action block when Maestro Plush Data Source Entity Id - In Stock is Equal to "TRUE".
Create Statuses to Update in Update Field Actions
In the module builder toolbar, select the Statuses button. The Statuses panel displays.
In the Triage & Coordination section, rename the second default status from "As Planned" to "Order Fulfillment", then rename the third default status from "At Risk" to "Order Cancelled". Update the "Order Cancelled" status type to Done.
Delete the default "Blocked" status as this won't be used.
Update Statuses in Update Field Actions
In the module builder, select the Out of Stock action block. The action panel displays.
Select the Field Name dropdown and select the Status field.
Select the Value dropdown and select Order Cancelled.
Select the In Stock action block. The action panel displays.
Select the Field Name dropdown and select the Status field.
Select the Value dropdown and select Order Fulfillment.
Update Request Tracker Interface with New Statuses
In the module builder toolbar, select the Interfaces button. The Interfaces panel displays.
Select the Request Details interface you created in the previous section. The interface builder displays.
Select the existing Status Progress Bar widget. The Status Progress Bar configuration panel displays.
Scroll down to the field list, locate the Order Fulfillment field, and select the corresponding checkbox to display this field in the widget.
Turn on the Enable Display Conditions toggle. A new conditions group displays.
Configure the conditions group to display the widget when Maestro Plush Data Source Entity Id - In Stock is Not equal to "FALSE".
Scroll to the top of the widget configuration panel and select the Duplicate button. A copy of the widget is added to the interface.
Update the widget title to "Order Out of Stock".
In the field list, deselect the Order Fulfillment field and select the Order Cancelled field.
In the Enable Display Conditions condition group, update Not equal to to Equal to. The widget should not be configured to display only when the item is not in stock (and thus the order is cancelled).
When finished, select Close in the upper right.
Test the New Logic
In the module builder, locate the Intake Interface Accessed trigger and select the Open Interface button,
, to open and test the intake sequence.
For the What type of plushy would you like to order? field, select Basic Maestro.
Enter relevant values for the remaining fields, then select Finish. The interface redirects us to the tracker interface where the Status Progress Bar displays the request as being in the Order Fulfillment status.
Return to the module builder and repeat the test, except this time select Beach Maestro for the What type of plushy would you like to order? field.
Enter relevant values for the remaining fields, then select Finish. The interface redirects us to the tracker interface where the Status Progress Bar displays the request as being in the Order Cancelled status.
You've added conditions to action blocks to create new logic and update the tracking interface with the new status. Next, we'll create new triggers and actions to send notifications to users when they submit an order.
Next Step:
8. Maker Course - Add Match Conditions Trigger and Send Notification Action