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 / Converting csv file to...
Power Automate
Unanswered

Converting csv file to txt using Power Automate

(0) ShareShare
ReportReport
Posted on by 6

Hey everyone,

I need to build a Power Automate Flow that takes a csv file that was uploaded to a shared drive in Sharepoint, converts it to a txt file and sends it as an attachment in an email.

I've tried several strategies to achieve this but I can't get the correct content, it's always outputting a txt file with just one line of random numbers and letters, not what is on the csv file.

Is there a simple way to do this?

Thanks

Categories:
I have the same question (0)
  • Alex_Rackwitz Profile Picture
    9 on at

    @RL3 

    Encodian's Convert Excel can convert CSV (as well as many other formats) to TXT.

    Alex_Rackwitz_0-1700181389085.png



  • RL3 Profile Picture
    6 on at

    Hey,

    I have implemented your suggestion but it seems like my problem is coming up before I get to that step, I've tried several inputs as the file identifier and they are all giving me an error when I get to the get file content step, it always says the file id is not valid, do you know what could be causing this?

     

    RL3_2-1700216660623.png

     

  • AlexEncodian Profile Picture
    4,409 Moderator on at

    @RL3 

    you’re using a SharePoint trigger and a OneDrive get file contents action. Use the SharePoint get file contents action

  • grantjenkins Profile Picture
    11,063 Moderator on at

    You can achieve this fairly easily using standard connectors (no need for a third-party solution).

     

    See full flow below. I'll go into each of the actions.

    grantjenkins_0-1700224595512.png

     

    When a file is created (properties only) will trigger when a file is uploaded into the specified folder. Note that you should use this trigger as appose to yours which is now depreciated.

    grantjenkins_1-1700224637765.png

     

    Get file content retrieves the content from the file using the Identifier.

    grantjenkins_2-1700224696912.png

     

    Send an email uses the Name of the file followed by .txt and the following expression to convert the content from base64 to text.

    base64ToString(outputs('Get_file_content')?['body']?['$content'])

    grantjenkins_3-1700224778138.png

  • RL3 Profile Picture
    6 on at

    I was using that previously and it wasn't working, then I saw in the outputs of the get file content action that it seemed it was retrieving the wrong content, that is why I attempted a different approach

  • RL3 Profile Picture
    6 on at

    I had tried this before and it didn't work, but I tried it again because I could be making a mistake in the attachment content part. However, this is what I'm getting now, do you have any idea how I can fix it? 

    RL3_0-1700233811016.png

     

  • AlexEncodian Profile Picture
    4,409 Moderator on at

    @RL3 

    Just a tip to help people help you. You need to paste your flows, with actions expanded, so that we can see what you have done. See how Grant showed you what his flow looks like

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

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard