Conditional expression in Workflow

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

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

1 Like

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

This appears to be working as intended. Thanks for another syntax lesson… I’m getting there slowly with everyone’s help.

Be safe
Ray

2 Likes