Conditional expression in Workflow

Ray
Participant III

Hello again - I am trying to limit emails from being sent before there any records are added to a child table.

I have an Orders table (OrderID) and an OrderDetails table (OrderDetailsID), that are referenced and dereferenced by the key field.

When I create an Order there are occasions when the record needs to be updated prior to any service being performed at a customer site. My workflow routine is set to look for updates to the Order table and send out a completion of service email to the customer. I would like to limit the email sending routine to only work when there are related records to the Order in the OrderDetails table.

I have set up a condition in my workflow:
([OrderEmail] = FALSE) AND (IN([OrderID], [Related OrderDetails][OrderID]))

The OrderEmail statement is needed to stop future emails going out if the completed order is modified as it proceeds through other phases of the system at our facility.

Iโ€™m looking for a way to look at the OrderDetails table for any record with an OrderID that matches the current one.

Thank you as always.

Ray

Solved Solved
0 2 153
1 ACCEPTED SOLUTION

Ray
Participant III

Hi Suvrutt - thank you. I was going to let you know about the opening bracket but you already spotted it

This appears to be working as intended. Thanks for another syntax lessonโ€ฆ Iโ€™m getting there slowly with everyoneโ€™s help.

Be safe
Ray

View solution in original post

2 REPLIES 2

If I have understood the requirement, you could please try

AND ([OrderEmail] = FALSE , COUNT([Related OrderDetails]) >0)

The suggestion is mainly for later part, that is for ensuring emails are not sent for empty order details records.

Edit: Minor corrections in the expression

Ray
Participant III

Hi Suvrutt - thank you. I was going to let you know about the opening bracket but you already spotted it

This appears to be working as intended. Thanks for another syntax lessonโ€ฆ Iโ€™m getting there slowly with everyoneโ€™s help.

Be safe
Ray

Top Labels in this Space