web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Manipulating data in a...
Power Automate
Unanswered

Manipulating data in a CSV into an Excel file

(0) ShareShare
ReportReport
Posted on by 4

I’m new to Microsoft Flow.

 

I have a csv file that contains the following data:

 

The headers are - "Role","Name", and here is a sample of the data.

 

“Student ”,”John Smith”

“Student ”,”Mary Scott”

“Student ”,”Joseph Doe”

“Tech”,”Joseph Doe”

“Tech”,”Peter Paul”,

“Admin”,”Peter Paul”

“Admin”,”John Smith”

 

 

As you can see a person can have more than one role.

 

I would like to use flow to create an excel spreadsheet where the Role is the column header with the names listed in a separate column and the role that they are assigned have a true/false indication.

 

The sample output I envision in Excel is:

Name.                         Student                 Tech                   Admin

John Smith                     X                                                     X

Mary Scott                     X

Joseph Doe                    X                           X

Peter Paul                                                    X                        X

 

For instance, in Java one could create a map where the key would be the person name and the value would be a map of the roles.  Then one could iterate through the input list and if the “next” person read was not on the map, one would create an entry for that person and the value map would have the role from the line read.  If the person already existed in the map, then the role just read would be added to the existing role map for that person.  After iterating through the data, I would be able to create the appropriate Excel spreadsheet by iterating through the map just created. I’m struggling to understand how I could do similar with MS flow.

 

 

Any help/suggestions would be greatly appreciated.

 

MLG

Categories:
I have the same question (0)
  • takolota1 Profile Picture
    4,980 Moderator on at

    @MLG 

    You should be able to use this CSV parsing template to pull the CSV data into dynamic content:

    https://powerusers.microsoft.com/t5/Power-Automate-Cookbook/CSV-to-Dataset/td-p/1508191

    From there you can use the Excel Update row & Create row action & some expressions with the dynamic content to achieve what you want.

    So you could set a List rows action to get a filtered set of rows that already has the person’s name. Then use a condition after that to check the length of the List rows action values output. If the length is greater than 0 then Update row, & if the length is less than 1 then Create row.

    And in these actions you can use expressions for the columns like Student or Tech like…

    if(contains(InsertRoleCSVDynamicContentHere, ‘Admin’), True, ‘’)

    If you put that in the input for the Admin column it will return TRUE when the row shows an Admin role value. It should leave it unedited if it doesn’t, that way each Update row action only adds a True value, it won’t over-write previous True values with a False.

  • MLG Profile Picture
    4 on at

    Thank you for the response and the link to your video which I viewed (and I plan to view a multiple times😀).  This appears to be along the lines of what I'm looking for.  Of course, there is a bit of an Excel learning curve and I plan to work on this over the next few days.  Hopefully, I'll be able to report success and will mark this as a solution.  Thanks again.

     

    MLG

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 550

#2
Valantis Profile Picture

Valantis 390

#3
11manish Profile Picture

11manish 348

Last 30 days Overall leaderboard