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 / Create CSV Table and w...
Power Automate
Unanswered

Create CSV Table and write to a CSV File - Missing Double Quotes

(0) ShareShare
ReportReport
Posted on by 36

Hi

 

I am trying to write a CSV file from a flow, I have an array object f JSON

 

sa105_2-1605763769014.png

 

 

 

Output is 

 

sa105_3-1605763826005.png

 

I want something like this

 

sa105_4-1605763890456.png

 

 

I have more than 50 columns in total, some have numbe4rs, text, multiple text and dates, I am showing only 2 columns in this example.

Categories:
I have the same question (0)
  • sa105 Profile Picture
    36 on at

    any help please?

  • Paulie78 Profile Picture
    8,422 Moderator on at

    Before I answer properly, may I ask what is the destination for the CSV? Excel? 

  • Verified answer
    Paulie78 Profile Picture
    8,422 Moderator on at

    Try this, I don't really feel good about this method, but it does what you want, I bet @Jay-Encodian would know a better way. I have a way that is better than this if the destination is Excel, but I don't know where you are putting the data.

    https://ibb.co/B2Y6v3w

    quotedCSV.png

     

  • sa105 Profile Picture
    36 on at

    Destination would be a document library, generated CSV will be emailed to a Shared mail box.

  • Paulie78 Profile Picture
    8,422 Moderator on at

    Just realised the expression isn't very clear in the screenshot above, here it is:

    replace( body('Create_CSV_table'), '^', '"')

    Basically putting a carat wherever a quote should go, you'll understand why I didn't just put a double quote if you try it.

     

    You can use anything you like instead of a Carat ^_^

  • sa105 Profile Picture
    36 on at

    Thank you for replying, It worked with the test data. I have more than 50 columns, putting '^' with all 50 columns is doable but is there any other dynamic way?

    I am currently using "Automatic" columns option in Create CSV action but if there is no other way, I will use this method.

  • Paulie78 Profile Picture
    8,422 Moderator on at

    That is kind of why I didn't like posting it, because of the number of columns you have. I do not know of another way, but I bet there is one and I'd like to know what it is.

  • Paulie78 Profile Picture
    8,422 Moderator on at

    Hold fire, I just thought of a better way 🤣 Let me test it quick.

  • sa105 Profile Picture
    36 on at

    No problem at all, I will definitely go for this method.

     

    Just on a side note, there is a Powershell way of doing it as well. CSV will be emailed to a shared email box and that document library is mapped as a network drive and there I can run import-csv and export-csv and it generates the same csv with double quotes in it. I have tried it worked but I wanted to do in Flow.

     

    I will definitely go with our solution.

  • sa105 Profile Picture
    36 on at

    yes, please if there is a better way.

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