Adding a Conditional Step in a Value Stream
Add conditional logic to the Hello World value stream so outreach runs only for specific form responses.
With the Hello World value stream from the first trail in place, you can add conditional logic to control when a process step runs. In this trail, you send an additional email notification only when the sender provides a specific form response.
You first create a new Make scenario, then apply a condition to the process step in the Hello World value stream.
Creating a new scenario to respond to senders needing outreach
Similar to Setting up a First Value Stream, create a scenario named Send a Survey Feedback that sends another email to form recipients.
Add the first Set Variable from Process Context module
Add the Set Variable from Process Context module and configure it:
Assign the data from the Trigger Event
Select the Hello World value stream
Use the latest Instance ID as the Example Instance – select the ID from the drop-down list. The ID at the top is from the latest instance
Select Hello World Feedback Sent as the Event Type
Select
emailfrom the Field drop-down listEnter
emailin the Variable Name field
Add the second Set Variable from Process Context module
Add a second Set Variable from Process Context module and configure it:
Assign the data from the Trigger Event
Select the Hello World value stream
Use the latest Instance ID as the Example Instance – select the ID from the drop-down list. The ID at the top is from the latest instance
Select Hello World Feedback Provided as the Event Type
Select
forms.0.payload.firstNamefrom the Field drop-down listEnter
firstNamein the Variable Name fieldSet Raise Error when Null to Yes
Add the Gmail module
Add the Gmail (Send an Email) module. This trail uses Gmail as the example mail provider, as in Setting up a First Value Stream. You can use any supported provider.
Test the value stream
Re-run the value stream by sending a new trigger event. Use the same Postman request or Celonis Action Flow you used in Setting up a First Value Stream.
After you send the event, you receive an email requesting a form response. After you submit the response, you receive a second email with a thank-you message.
Applying conditional logic with JSON
Up to this point, the Send a Survey Feedback scenario runs for any form response. Limit the step so it runs only when the response is indifferent or sad. Apply a condition on the Send a Survey Feedback process step in the Hello World value stream.
Enter the JSON Logic expression
Open the Condition tab. In the JSON Logic Expression field, enter the following expression:
{
"in": [
{
"context": "hello_feedback_provided.forms.0.payload.sentiment"
},
[
"indifferent",
"sad"
]
]
}The condition maps variables to the relevant fields in your process context.
Test with different form responses
Send the event request again using Postman or Celonis Action Flow. You receive a form submission request again.
Submit happy as the response – the Send a Survey Feedback process step does not run.
Submit indifferent or sad – the Send a Survey Feedback step runs and you receive another email with the thank-you message and next-step information.
You can also use events as conditions on process steps. Multiple events can be assigned to a step or group of steps, and both IN (OR) and AND operators are supported. This is the preferred option when you only need to test for the presence of an event.
Last updated
Was this helpful?

