Conditional Email Sending Based on Report Data

Hi everyone,

I have a workflow that downloads a report from SAP, performs calculations, and then triggers another workflow to send the report via Outlook email. However, the report content varies—sometimes it’s blank, and other times it contains data.

I’d like to modify the email workflow so that the robot only sends the email when the report is not blank. Could anyone guide me on how to set up this condition to prevent sending emails with empty reports?

Thanks in advance for your help!

@mohammed.fuseini,

  1. Use Read Range Workbook activity to read the report file. This will return you Datatable.
  2. Use If activity to check if need to send the report or not.

Condition: datatableVariable.RowCount>0
True Send Report
False: Don’t send

1 Like

Thanks @ashokkarale for the earlier advice on checking if reports are blank! Now i am able to tell which datatable are empty or not. However, I need additional help to configure my email process as follows:

  1. Selective Email Sending: All report files are stored in a single folder, with filenames starting with “Final” plus a unique description. I need the robot to only send an email when at least one of these “Final” files contains data. If all “Final” files are blank, the email should not be sent. (Because i still receive email with blank file attached, due the the logic i use to attached files. I use thr keep word final*)

  2. Conditional Attachment of Non-Blank Files: When sending the email, I want the process to only attach “Final” files that are not blank.

Could you help me configure:

How to check if at least one “Final” file is non-blank and, if so, proceed with sending the email?

How to attach only the non-blank “Final” files to the email?

Thanks in advance for any guidance on setting up this logic!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.