web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Controlling when an em...
Power Automate
Suggested Answer

Controlling when an email is sent based on content of an Excel File

(0) ShareShare
ReportReport
Posted on by 6
I am using PowerAutomate to send emails weekly to customers with a spreadsheet attached containing sales order data.  From time to time the customer does not have any live sales orders and so the spreadsheet does not contain any sales order data.  Is there any way for the email to NOT SEND if the spreadsheet contains no data? Or is there any other way of controlling when a customer email sends that does not require manually turning off the flow?
Categories:
I have the same question (0)
  • David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at
    You can use the List rows action and then use a length expression to see if there are any rows in the table. If there are more than one row, send the spreadsheet. Of course, it would be best if you show your flow so we know what you have configured as this answer may not apply.
  • LBugg Profile Picture
    6 on at
    Thank you David,
    I am new to PowerAutomate.  This solution sounds promising.  I have 2 sheets in the spreadsheet - one contains a pivot table and the other (hidden sheet) contains a table but there is something in the first row, the table starts on row 2.  
    How do I share my flow with you so you can check?  
     
  • David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at
    In Microsoft Edge you can press <Ctrl>+<Shift>+<S> to take a screen shot. Choose Area from the menu and then drag a box around your flow actions. Press copy in the toolbar and you can then paste the image into your post using <Ctrl>+<v>. 
  • LBugg Profile Picture
    6 on at
  • Suggested answer
    David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at
    I thought your issue is you wanted to send the e-mail based on the content in an Excel file? There are no Excel actions in your flow. How does what you show relate to what you are asking? Based on the limited information of your use case, you would at a minimum need to do something like this:
     
    Even the above is making a lot of assumptions about your process. It assumes that you have one spreadsheet for the process and that the sales order data is contained in a table. If so, list the rows in the table corresponding to the customer and use a length expression to check the number of rows. Since all tables have a header row, there must be at least one row, so you want to check if there is more than one row. If there is, on the true side you would send the e-mail and on the false side do nothing or something you have not mentioned in your post. The expression in the condition to get the number of rows is: length(outputs('List_rows_present_in_a_table')?['body/value'])
     
    I cannot provide anything more than a high-level suggestion based on the information you have provided. To provide a more accurate recommendation, we need a bit more detail about your current setup. Specifically, it would be helpful to know how the spreadsheet is generated and whether there is more than one spreadsheet involved. Additionally, understanding the organization and content of the spreadsheet is crucial. For instance, where does the email address for sending the email to the customer come from? Is it included in the spreadsheet, or does it come from another source? If it’s from another source, how is the relationship between the spreadsheet and the recipient established? Any additional information about your process will help us give you a more precise and effective solution.
     
    Here are a few more questions that could help clarify the requirements for building this workflow:
    1. Data Source: How is the sales order data collected and stored before it is placed into the spreadsheet? Is it coming from a database, an API, or another source?
    2. Spreadsheet Format: Are there specific columns or headers that are always present?
    3. Trigger Conditions: Are there any specific conditions or criteria that determine when an email should be sent, aside from the presence of data in the spreadsheet?
    4. Error Handling: How should the workflow handle errors or exceptions, such as issues with data retrieval or email sending failures?
    5. Customer List: Is the list of customers static, or does it change frequently? How is this list maintained and updated?
    6. Email Content: Is the email content static, or does it need to be dynamically generated based on the data in the spreadsheet?
    7. Security and Compliance: Are there any security or compliance requirements that need to be considered, such as data encryption or privacy regulations?
    Your best bet will be to start building something and then when you encounter a specific issue, post a question specific the that issue instead of asking how to build a complete solution, which is something these forums are not designed to do.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard