Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Best way/Guidance to format inbound Information from API call.

(0) ShareShare
ReportReport
Posted on by 19

Hi All,

 

I need some pointers on how to format data I am receiving from an API call, so that it can be piped out into an external CSV file.

 

The inbound data has been parsed, created as a CSV table and then appended into an Array and looks like this:

PowerAutomate_ParsingCSV_01.jpg

 

 

After all the records have been processed via the API call my array looks like this:


PowerAutomate_ParsingCSV_02.jpg

Each "ID,CID,Current_IP…” line being the result of one iteration of the Apply to Each API call.

 

The end result of this workflow gives me this CSV:

PowerAutomate_ParsingCSV_03.jpg

PowerAutomate_ParsingCSV_04.jpg

Which is clearly not in a usable format, but at least it’s piped out the raw information.

 

How do I get the information formatted like:

 

ID,CID,Current_IP

nff7f3367cc394513937c5c253f63d57a,CID_123,192.168.0.1

abc3456430adior,CID_456,192.168.100.100

 

I suspect it's something to do with the /r that have been inserted? This is my first workflow, and I'm pretty sure there are many ways to streamline the process, so guidance is appreciated!

 

Thanks

  • Charsiu Profile Picture
    19 on at
    Re: Best way/Guidance to format inbound Information from API call.

    We have finally got there! Thank you so much for your time and perseverance with this Ellis 😃👍

     

    PowerAutomate_ParsingCSV_Suggestion07.jpg

     

    Now I can continue on building the content of the report, you've helped me a great deal!

     

  • Verified answer
    Ellis Karim Profile Picture
    11,143 Super User 2025 Season 1 on at
    Re: Best way/Guidance to format inbound Information from API call.

    Thanks for the screenshots and for posting the error messages. I've created an example flow, though not exactly the same as yours the same concepts and actions should produce the CSV file.

     

    For this flow, do not use the Select action, instead construct the a JSON item in the Append to Array action as shown below:

     

    Capture.JPG

     

    Example output:

    Capture2.JPG

     


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

  • Charsiu Profile Picture
    19 on at
    Re: Best way/Guidance to format inbound Information from API call.

    I get the same error, which was why I had the create CSV prior to the append Array: 

    PowerAutomate_ParsingCSV_Suggestion06.jpg

  • Ellis Karim Profile Picture
    11,143 Super User 2025 Season 1 on at
    Re: Best way/Guidance to format inbound Information from API call.

    Try the following modifications:

    2021-12-10_13-16-37.png

    Move the Create CSV table action OUTSIDE of the Apply to each loop.

     

    Similar to what I suggested in the following flow chart:

     

    Untitled Diagram.drawio2.png

     


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

  • Charsiu Profile Picture
    19 on at
    Re: Best way/Guidance to format inbound Information from API call.

    PowerAutomate_ParsingCSV_FullFlow01.jpg

  • Ellis Karim Profile Picture
    11,143 Super User 2025 Season 1 on at
    Re: Best way/Guidance to format inbound Information from API call.

    Sorry, I meant could you please share screenshots of the flow.

     

    Ellis

  • Charsiu Profile Picture
    19 on at
    Re: Best way/Guidance to format inbound Information from API call.
    Can you please share the flow as  I'm not clear on the steps why you are creating a CSV file then appending the content of the CSV action to an array. 

    I'm using the Array as a means of collating all of the outputs from individual API calls, and then the idea was to pipe out all the information into an external file - as oppose to doing a File append after each iteration (which had it's own issues).

    But given how new I am to this, I expect there are lots of room for improvement in my flow.

     

    I couldn't share my Flow directly, but I have done an Export of it (after sanitising credentials, etc).

     

    Your time and help is much appreciated!

     

    https://1drv.ms/u/s!As_e_pwBk-z-v2jluSZg5Z9qWwys?e=izmHtX 

  • Ellis Karim Profile Picture
    11,143 Super User 2025 Season 1 on at
    Re: Best way/Guidance to format inbound Information from API call.

    Can you please share the flow as  I'm not clear on the steps why you are creating a CSV file then appending the content of the CSV action to an array. 

     

    I'm guessing, but is logic of the flow similar to this:

    Untitled Diagram.drawio.png

     

    You could try :

     

    Untitled Diagram.drawio2.png

     


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

  • Charsiu Profile Picture
    19 on at
    Re: Best way/Guidance to format inbound Information from API call.

    Hi Ellis,

     

    Thanks for the suggestion and it feels like I'm a step closer.

     

    During the Create CSV Table stage I just left it configured as the "Output" of the "Select" step, which resulted in a table full of "\r\n"

    PowerAutomate_ParsingCSV_Suggestion01.jpg

     

    PowerAutomate_ParsingCSV_Suggestion02.jpg

     

    Then I amended the fields in the "Create CSV table" step so I'm explicitly specifying the properties

     

    PowerAutomate_ParsingCSV_Suggestion03.jpg

     

    Which yields the same results as before. My "Compose" step performs two functions for me, one is to validate the contents of it and also as a means to use it to populate the "Create File" step, as my ReportBuffer Array cannot be specified for the the File Create?

     

    PowerAutomate_ParsingCSV_Suggestion04.jpgPowerAutomate_ParsingCSV_Suggestion05.jpg

     

  • Ellis Karim Profile Picture
    11,143 Super User 2025 Season 1 on at
    Re: Best way/Guidance to format inbound Information from API call.

    You want to do something similar to this :

    2021-12-09_21-50-03.png

     

    The details of the Select action will depend on output of the API call. 

     


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a 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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1