Showing results for 
Search instead for 
Did you mean: 
Level: Powered On

Create Separate Excel Files Based on Field Value

Hi everyone!


I'm just starting to get my feet wet with Microsoft Flow! It's exciting, but I need some advice! Can you seasoned Flow users offer a newbie some advice/point me in the right direction?

My goal is to read in an Excel file and split it into multiple Excel files based on the Location field. For my sample data below, I'd like to generate 3 files - one for Los Angeles, one for San Diego, and one for Santa Ana. 
Sample Data.PNG







So far, I've been able to use Filter Array for one city at a time, but how can I change this to dynamically filter for each city name? 

Here's my flow so far: 

Flow 1.PNG





Also, my Create File step generates a file, but I receive a "Couldn't Open the Workbook" message. How can I configure the Create File step to fix this issue? 

Flow 2.PNG

Level: Powered On

Re: Create Separate Excel Files Based on Field Value



Maybe you could first create a variable (array type) where will be all your locations. For this you could list all the rows and loop thru them and add the location in the array if the location doesn't already exists.


And then you could basically loop thru your data again but now filtering using your variable, like this: for each variable, loop thru the excel rows, if variable value= location of the current row do something.


Hope this helps you 🙂


Level: Powered On

Re: Create Separate Excel Files Based on Field Value

Thank you so much! 

Helpful resources


New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!


Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!


Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!


Microsoft Learn

Learn how to build the business apps that you need.


Power Platform World Tour

Find out where you can attend!


Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (3,846)