BuildShipBBuildShip
Powered by
ThomasT
BuildShip•2y ago•
4 replies
Thomas

Switch Node: one case for several conditions

How do I define a case for several conditions? For expression value "type" I want "case 1" to be true for values: "checkout.session.completed", "customer.subscription.created", "customer.subscription.updated"

I tried so far:

["checkout.session.completed", "customer.subscription.created", "customer.subscription.updated"]

"checkout.session.completed" || "customer.subscription.created" || "customer.subscription.updated"

"checkout.session.completed", "customer.subscription.created", "customer.subscription.updated"
["checkout.session.completed", "customer.subscription.created", "customer.subscription.updated"]

"checkout.session.completed" || "customer.subscription.created" || "customer.subscription.updated"

"checkout.session.completed", "customer.subscription.created", "customer.subscription.updated"
Solution
Hey Thomas, the Switch Node executes the sequence whose case value matches the evaluated expression value, and this check is performed using the strict equality operator.

One thing you could try is evaluating the incoming event in the expression and classifying it as required, see attached image for an example (if the incoming event is present in the array, the condition evaluates to true and
case1
case1
is returned as the expression, which is then matched against the cases that follow)
image.png
Jump to solution
BuildShip banner
BuildShipJoin
Join founders, builders, devs using Low-code / No-code to create backend, APIs, scheduled Jobs, automation, AI workflows
7,971Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Switch case can't get value returned from case
khiemnd5Kkhiemnd5 / ❓・buildship-help
2y ago
Facing issue with Switch Node
AKGDEV7AAKGDEV7 / ❓・buildship-help
9mo ago
"Can't migrate the workflow. The workflow contains a switch node."
BrianBBrian / ❓・buildship-help
15mo ago
Custom Lo-Code for Node
pgiesinPpgiesin / ❓・buildship-help
2y ago