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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Send an email after ta...
Power Automate
Suggested Answer

Send an email after table/formula is inserted into excel spreadsheet

(0) ShareShare
ReportReport
Posted on by 12
I have a form that populates a spreadsheet, and then a table that is formulated to calculate the highest ranked person. I want it to send an email to a person after all participants have completed the form.  What am I missing????
 
Categories:
I have the same question (0)
  • Suggested answer
    Sunil Kumar Pashikanti Profile Picture
    2,318 Moderator on at
     
    Your flow always sends the email immediately after the script runs, but you never check:
         Whether all participants have completed the form
         Whether the formula/table has finished calculating
         Who the "highest ranked" person actually is
    Your flow is missing logic between “Run Script” and “Send Email”.
     
    What You Need to Add
    Step 1: Have your Office Script return data. Your script must return 
        the highest ranked person
        the completed count
        the expected count
    Step 2: Insert a condition to validate the count
    if the completed count matches with expected count, then send email, else wait or do nothing.
     
    As I don't know about the architecture of your project, can't help more thatn this.
     
     
    ✅ If this answer helped resolve your issue, please mark it as Accepted so it can help others with the same problem.
    👍 Feel free to Like the post if you found it useful.
     
  • Suggested answer
    11manish Profile Picture
    3,333 on at
    You need to add a Condition action between your Excel script and the email step.
     
    1. Update your Excel Table/Script
    Ensure your Excel table has a cell that counts total submissions (e.g., using =COUNTA(Table1[Name])). Your "Run script" action should return two pieces of information:
    • The Current Count of submissions.
    • The Target Count (how many people are supposed to take the form).
    2. Add a Condition in Power Automate
    Insert a Condition action after the "Run script" step:
    • Left Side: Return_Count (from your script).
    • Operator: is equal to.
    • Right Side: Target_Count (e.g., 10 or a dynamic value from your spreadsheet).
    3. Move the Email Action
    • Drag your Send an email (V2) action into the True (Yes) branch of the condition. Leave the False (No) branch empty.
  • KJ-09011516-0 Profile Picture
    12 on at
    Thank you for your responses. I'll try them :)
  • KJ-09011516-0 Profile Picture
    12 on at
    @Sunil Kumar Pashikanti @11manishI am still not getting this right.
     
  • Sunil Kumar Pashikanti Profile Picture
    2,318 Moderator on at
     
    Your error occurs because:
         The File field contains a sharing link, which Excel Online cannot use 
         The Script field contains a formula, not an Office Script ID
    Fix those, and the dynamic values will load correctly.
     
    Follow the below link for more details:
     
    The Run script action with completed fields that show the location is 'OneDrive for Business', the document library is 'OneDrive', the file is 'daily-readings.xlsx', and the script is named 'Format Table'.
     
    References:
     
     
    How to Fix It
     
    Step 1: Fix the File reference
    You must use a proper file path.
    If the file is in OneDrive:
         /Documents/yourfile.xlsx
    If it’s in a SharePoint library:
         /Shared Documents/Folder/yourfile.xlsx
    Not a sharing URL.
     
    Step 2: Fix the Script field
    You must provide the Office Script ID.
    To get it:
         Oepn Excel Online
         Go to Automate → All Scripts
         Click the script
         Script details panel → copy Script ID
    It will look like:
         c0af23cd-32cd-4dfe-8350-94874292b6fe
    Paste that into the Script field in Power Automate.
     
    Step 3: Convert your idea into an Office Script
    You cannot directly run =MAX(C36:C40) from Power Automate.
    You need an Office Script something like belwo:
     
    function main(workbook: ExcelScript.Workbook) {  const sheet = = sheet.getRange("C36:C40");  const sheet = workbook.getWorksheet("Sheet1");  return range.getValues().flat().reduce((a, b) => Math.max(a, b));}Show more lines
     
    Then call it from Power Automate.
     
    ✅ If this answer helped resolve your issue, please mark it as Accepted so it can help others with the same problem.
    👍 Feel free to Like the post if you found it useful.
     
     
     
     
     
     
  • KJ-09011516-0 Profile Picture
    12 on at
    I am stuck. I know I am thinking too much about this and it is easier than I am making it. I just wanted a simple form, find the highest ranked instructor, and email him/her. UGH! Thank you for trying to help @Sunil Kumar Pashikanti @11manish
  • Suggested answer
    Sunil Kumar Pashikanti Profile Picture
    2,318 Moderator on at
     

    Thanks for your patience! I’ve put together a complete example using Microsoft Forms, Excel, Office Scripts, and Power Automate. It includes a fully packaged Power Platform Solution that you can download, import, and configure with your own form and Excel file.

    I’ve also written a step‑by‑step article that walks through everything, the setup, the script, the flow logic, and how it all connects. You should be able to follow it end‑to‑end and adapt it to your scenario.

    Here’s the guide:

    🔗 Automating Instructor Evaluations with Microsoft Forms + Excel + Script + Power Automate

    Give it a look and see if it fits your requirement. If you run into any issues while testing or importing the solution, feel free to reply back, happy to help!

     

    Thanks!
    @Sunil Kumar Pashikanti

     

    ✅ If this answer helped resolve your issue, please mark it as Accepted so it can help others with the same problem.
    👍 Feel free to Like the post if you found it useful.

     

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard