Branch on the return-eligibility rule
A return is only allowed when the order is closed. You capture the reply in a variable, then branch on the order's status. In Northwind, a closed order has order status 3.
Add a Variable action to hold the response you'll send back. The node lands on the canvas named Variable. In its panel, under Initialize Variable, set Variable name to
response, set Type to String, and leave Value empty.The action's own title stays Variable. Rename it so the flow reads at a glance, the same way you renamed List Order Rows. Select the Variable title at the top of the panel and enter:
Initialize Response
Note
💡 Tip: The same panel can hold more than one variable operation. The + Initialize Variable and + Update Variable buttons at the bottom add them. This lab needs only the single response variable here.
Add an If/Else (condition) action to check whether the order status is closed.
In the condition's left value, choose Insert expression and use the Copilot expression builder. Enter this natural-language prompt to generate the expression:
Get the first row of List Order Rows action and get the order status ID valueInsert the generated expression. It resolves the order-status value from the first returned row. The builder references the List rows action by an internal connector ID rather than its display name, so your expression will look similar to this, with your environment's own ID in the middle:
first(body('connector-<internal-id>')?['value'])['nwind_orderstatusid']Don't edit the ID or tidy it up: the shape is what matters (the first returned row's
nwind_orderstatusidvalue) and the generated reference is correct for your flow.Set the operator to is not equal to and the value to 3. Rename the branch so it reads If not a closed Order. The Else branch handles closed orders that are eligible for a return.
✅ Checkpoint: An If/Else condition splits the flow: the If not a closed Order branch handles orders that aren't closed yet, and the Else branch continues for closed, return-eligible orders.


