Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
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

  • AaronUT Profile Picture
    4 on at
    Re: Flow saving email attachment in Sharepoint for PowerBI refresh

    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
  • SamLed Profile Picture
    2,332 Moderator on at
    Re: Flow saving email attachment in Sharepoint for PowerBI refresh

    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
    Re: Flow saving email attachment in Sharepoint for PowerBI refresh

    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,332 Moderator on at
    Re: Flow saving email attachment in Sharepoint for PowerBI refresh

    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.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow