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 / Flow saving email atta...
Power Automate
Unanswered

Flow saving email attachment in Sharepoint for PowerBI refresh

(0) ShareShare
ReportReport
Posted on by 4

Hi,

 

I have created a flow which would automatically save attachment from outlook of specific header into sharepoint and rename the excel file based on the filename .time. XLSX

 

The files in the sharepoint folder are then connected to PowerBI for scheduled refresh.

 

However, i am facing an error when importing the data that PowerBi does not recognize the format of the first file and that it only supports (Text, CSV Excel Workbooks, etc.)

 

The file extension that is saved can be accessed via sharepoint in excel table format.

If i were to park the file directly into sharepoint without using flow, i am able to import the data into PowerBI.

 

For my flow, i have used variables to store the string filename and string filetype XLSX then concatenate the name of the file along with the extension together.

Extension have already been changed to full uppercase.

 

Please let me know if there are any errors due to extensions that i may have missed out

 

Thank you for your help

Categories:
I have the same question (0)
  • SamLed Profile Picture
    2,338 Moderator on at

    Hi @AaronUT,

     

    Allow me to formalize what I understood and tell me if that's it.

    You receive excel file attached to a mail you select according to its header. Then you get that attachment content  and create a file to a SharePoint library. you also rename original filename adding time. But uploaded file is not recognized as a valid Excel file when it arrives in SharePoint. Issue you don't have when you manually upload it.

     

    Did I understood correctly your issue ? 

     

    Please post also screens of your flow, focusing on content retrieving and file creation action configuration.  

    ______________________________________________________________

    If I have answered your question, please Accept the post as solution.
    If you like my response, please Thumbs Up.

  • AaronUT Profile Picture
    4 on at

    Hi,

     

    Below is the flow that extracts the email attachment based on subject title of email.

    AaronUT_1-1707360432438.png

     

    AaronUT_0-1707360401757.png

     

    The "apply to each 2" condition is created by Flow automatically.

     

    When looking at the output for content type on the attachment, it seems like the flow does not take the attachment as an excel.

     

    AaronUT_2-1707369854694.png

     

    Thanks 

  • SamLed Profile Picture
    2,338 Moderator on at

    Hi @AaronUT,

     

    File content may be Base64 encoded. So, give a try converting "File content" dynamic content by using base64ToBinary().

    ______________________________________________________________

    If I have answered your question, please Accept the post as solution.
    If you like my response, please Thumbs Up.

  • AaronUT Profile Picture
    4 on at

    Hi @SamLed ,

     

    Thanks for your reply. I have tried out the flow but am getting an error it is returning null.

     

    AaronUT_0-1707960586860.png

     

    I am converting using below code. I use attachments content as "Attachments" is not an option when i look through the dynamic selection. 

    AaronUT_1-1707960805474.png

    "base64toBinary(triggerOutputs()?['Attachments content'])"
     
    Thanks

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

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard