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 / Trying to make a flow ...
Power Automate
Unanswered

Trying to make a flow that reads attachment content (excel file) from email and post in the teams channel.

(0) ShareShare
ReportReport
Posted on by 13
Hello everyone,
I m trying to make a flow that whenever an email arrives with an attachment (excel) it will post attachment content in the team's channel, I tried searching everywhere but can't find any solution as Excel connector just doesn't support dynamic content in the File field I even tried following some solutions but as I m taking attachment from the email it automatically applies to apply to each in which I cant use initialize variable to set file id variable.
 
Can anyone here help me complete this flow, I m new to this thanks.
Categories:
I have the same question (0)
  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @Shaikhsaqib321 

     

    Does the file contain a table (as there are excel table actions)?  Or do you want the flow to detect the text in the Excel File using Office Scripts?

     

    If you are using the When a new email arrives (V3) trigger, you would need to get the attachment(s) and save them to OneDrive or SharePoint temporarily if you then want to convert the content to an HTML table or similar.

     

    Flow will automatically try and put you into an apply to each as the results from the attachment is an array and so it will assume there will be more than 1 attachment.  I've got a video about JSON Arrays worth watching too

     

    Or do you simply want to provide a link to users in Teams?

     

    Have a think about what you require and I will try and help.

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Cheers,
    Damien


    P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

     

  • Shaikhsaqib321 Profile Picture
    13 on at

    Hey, @DamoBird365  thanks for your response,

    I m trying to get the content of the excel attached in the email to the teams..

     

    this is the flow I edited: 

    Shaikhsaqib321_0-1622316527290.png

     

    but it's not reading the excel file which has a table like this, it depends on the submission sometimes there are 2 or 3 rows.

    Shaikhsaqib321_1-1622316629959.png

     

    Thanks

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @Shaikhsaqib321 

     

    Are you actually sure that the data in Excel is saved as a table? To me it just looks like a bunch of rows of data.

     

    See my example table below, can you view "table design" and the table name?  As you have selected the row already in your screenshot, it looks like no.

     

    DamoBird365_0-1622318585543.png

     

    Does your flow "get tables" action return any table names? 

     

    If NO, then you could look at using Excel Office Scripts.  I have previously highlighted a video that you might want to watch.   Detect the text in an Excel File this video will demonstrate how you can add a table to a file based on the file content and either use the get rows action OR simply return the value of the identified cells to the flow as a result.

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Cheers,
    Damien


    P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

  • Shaikhsaqib321 Profile Picture
    13 on at

    Hey @DamoBird365 appreciate the quick response :D!

     

    Actually no it's not saving it as a table that's why it's failing, I checked your video it was awesome but I m really new to this and don't know much about how do I use excel script where do I save it or how it will automatically create a table for every other file that gets added to the onedrive folder.

     

    Can you please help me on how do I use this script in the flow to after create file step, file excel file is getting created in the onedrive folder what do I need to do after that? how do I use the script you've shown in the video.

     

    Thanks

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @Shaikhsaqib321 

     

    The script is built in excel online... you can follow the build process here https://techcommunity.microsoft.com/t5/microsoft-365-pnp-blog/excel-scripts-and-cloud-flows-data-manipulation/ba-p/2356956

     

    Damien

  • Shaikhsaqib321 Profile Picture
    13 on at

    Hi @DamoBird365 ,

     

    created the script and uploaded it to the location where the attachment file will get created everytime email arrives, but I m not sure how it will select the script for every new file? 

     

    Attaching a screenshot with the error:

     

    Shaikhsaqib321_0-1622323337612.png

    Shaikhsaqib321_1-1622323391719.png

     

     

     

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Do you want to try file ID instead of name? 🤞

  • Shaikhsaqib321 Profile Picture
    13 on at

    Shaikhsaqib321_0-1622325542833.png


    No output 😕 , what if I write the expression ? outputs('Create_a_Table_in_Excel_(Excel_Scripts)')?['body/result']

     

     

  • Shaikhsaqib321 Profile Picture
    13 on at

    Hi @DamoBird365 

     

    I was finally able to select the script but now it's giving me a new error, and I m guessing it because the excel file format is csv and it needs to be xlsv to make changes? any way I can convert it to xlsv to run the script?

    Shaikhsaqib321_0-1622337959947.png

     

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 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard