I am trying to create a script that looks at emails that have been received in a specific Outlook folder. If there are no emails in that folder i want to perform an action. At present I am using “Get Mails” but when that finds nothing it ends the workflow. How can i find out if there are zero emails and perform an action.
The idea behind most activities is “get something, and if something was found execute the body of the activity”. That leave a problem with cases where you want to do something is nothing was found.
The solution is to save the result of the query. So all Get Element
activities has a Elements
property you can use to check how many results was found, so AFTER the Get Element
you can use the If
activity and check the number of results found ( and then set Min Items
to 0 on the Get Element
, so you don’t get an error )
You can do the same for Get Mails
, by setting the Emails
property, you can then use that variable in an If
activity AFTER the Get Mails
activity has run.
Thats great thanks so much. The issue I was having was not setting a variable with the result of Get Mails within its container.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.