I am trying trigger an email process upon email arrival.
The first criteria is whether an email has an order number in the subject.
However, if it does not, then it needs to process the email if an order number is in the body of the email.
Right now I have two outlook triggers within a trigger scope. One is looking for an order # in the subject and the other in the body.
This has been working fine except for the case when an email has an order # in the subject AND the body. In this case, it will try and process the same email twice and break.
Is there a way I can add logic to the Trigger Scope?
I want to trigger Order # that is in subject OR the body.
Yes, you can add conditional logic to your Trigger Scope to handle the case when an email has an order number in both the subject and the body.
One way to achieve this is to use an If activity within the Trigger Scope, and check whether the email subject contains an order number or not. If it does, you can process the email and exit the Trigger Scope. If it does not, you can use another If activity to check whether the email body contains an order number. If it does, you can process the email and exit the Trigger Scope. If it does not, you can exit the Trigger Scope without processing the email.
Here’s an example of how you can implement this logic:
Set up your Trigger Scope to listen for incoming emails.
Within the Trigger Scope, add an If activity with the condition “email.Subject.Contains(orderNumber)”. Replace “orderNumber” with the actual order number you are looking for.
If the condition is true, process the email and exit the Trigger Scope. You can use another Sequence or Flowchart activity to handle the email processing.
If the condition is false, add another If activity with the condition “email.Body.Contains(orderNumber)”. Replace “orderNumber” with the actual order number you are looking for.
If the condition is true, process the email and exit the Trigger Scope.
If the condition is false, exit the Trigger Scope without processing the email.