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 file from a...
Power Automate
Unanswered

Create CSV file from apply to each

(0) ShareShare
ReportReport
Posted on by 240

Hi Folks,

 

I have a flow in which I am parsing json, in that JSON I need name and values from 2 different forms, and want to create a common csv file from them. I am not able to append one csv . Please help

 

PowerUser0_0-1644394472943.png

This is the entire structure of flow what I am trying right now, 

PowerUser0_1-1644394593835.png

This is the output of one form, as you can see I need name and values which is inside field_data array, similary I have one more form, now please help anyone, like how I can create two rows which will have all the name and values of both the form

@Expiscornovus @jinivthakkar @Mister_Shaik @ekarim2020 @gabibalaban @RezaDorrani 

Categories:
I have the same question (0)
  • PowerUser0 Profile Picture
    240 on at

    Any help is appreciatedn @tom_riha @abm  

  • Mister_Shaik Profile Picture
    1,008 on at

    Hi @PowerUser0 ,

     

    There are a few things that are not quite clear, but I'm giving you a solution based on my assumptions, please do let me know if it's wrong.

     

    You have a loop, where you're getting the data and parsing it. Now the output of that parsed data is to be converted into a csv for your consumption in other actions. In this case, you can do the following,

    1. Create a array variable to store the joined array data
      1. variable.PNG
    2. After the parse json, use a compose to join both the Variable data and field_data's data
      2. collect.PNG

    3. Now after all those actions, outside the main ApplyToEach loop, create your csv using the data in the array variable
      3. create csv.PNG

     

    This way, you are having a single array variable collecting all the data across the different loops and at the end, you can use that array to create your csv.

     

    Hope my assumptions are not wrong and this helps you 🙂

     

    Kind Regards,

    Shaik Sha
    ________________________________________________________________________

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

  • PowerUser0 Profile Picture
    240 on at

    Hi @Mister_Shaik Thanks for your reply I really appriciate that, I am pasting the real output which I am getting from parse json,

    {
    "data": [
    {
    "created_time": "2022-02-13T16:39:36+0000",
    "id": "151606954886765",
    "field_data": [
    {
    "name": "languages",
    "values": [
    "english"
    ]
    },
    {
    "name": "first_name",
    "values": [
    "Roopa"
    ]
    },
    {
    "name": "last_name",
    "values": [
    "Shree"
    ]
    },
    {
    "name": "email",
    "values": [
    "roobash@gmail.com"
    ]
    },
    {
    "name": "company_name",
    "values": [
    "L"
    ]
    },
    {
    "name": "date_of_birth",
    "values": [
    "1/04/1999"
    ]
    },
    {
    "name": "gender",
    "values": [
    "female"
    ]
    }
    ]
    },
    {
    "created_time": "2022-02-11T18:32:25+0000",
    "id": "5506756899180",
    "field_data": [
    {
    "name": "languages",
    "values": [
    "hindi"
    ]
    },
    {
    "name": "first_name",
    "values": [
    "Rahul"
    ]
    },
    {
    "name": "last_name",
    "values": [
    "Bajpai"
    ]
    },
    {
    "name": "email",
    "values": [
    "bajpai@gmail.com"
    ]
    },
    {
    "name": "company_name",
    "values": [
    "Tech"
    ]
    },
    {
    "name": "date_of_birth",
    "values": [
    "0/17/1997"
    ]
    },
    {
    "name": "gender",
    "values": [
    "male"
    ]
    }
    ]
    }
    ],
    "paging": {
    "cursors": {
    "before": "QVFIUm5TTXdZARkxuSkhlQVlluRUtrWGRObE9MenRnN2JoSzRzS0VJb00tMTA0QWxZAQ0xOM21jQnFDZA1lQbXNPbU13",
    "after": "QVFIUjJNMVhvS2xGbFA5N1ZA3NWNmVzFjMGJqaWswOW9ZAY0hvMkxmQzdRT29IVXA2RW1YYlFsV19DYmFfaEZAvQThxSTln"
    }
    }
    }

     

    Now, I need to create a CSV file with Name as the headers of CSV file and values should be the values for those header , so as you can see I have two id's that means these are two should be two entries in CSV file

    I hope this will give more idea,

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