cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Regular Visitor

Get list from file and act on each entry

Hi all - I have a task which I'm currently doing on-prem that I'd like to move to the cloud.  It seems like a perfect fit for power automate, so I though I'd try making it as my first 'real' flow, but I'm stuck on how to get and work with the data. 

I need to get a list of addresses from someone, then send a message to each address in the list.  Currently, they save the list in a text file, one address per line, on a network share.  I have scheduled a powershell script to get the content of those files and for each line in the file send a message to the listed address.  
I wanted to start simple, just moving this entire process online.  I was thinking I would have them save the list as a text or excel file in a specific folder in a sharepoint library, and trigger the flow to run when a new file is created in that folder.  I know the action I want to perform on each item in the list, but I'm stuck on what happens in between.  How do I 1) Get the list from the file and 2) Create a foreach loop to act on each entry in the list? 

Eventually, I will probably try to integrate this further into their existing process, perhaps pulling the data from it's original source rather than having someone copy and paste it into a file just for this task, but I figure if I can get this working in it's simplest form right now then I can build on it from there. 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

Hi @NeighborGeek 

 

If you looking to read the excel contents then you need to use List rows present in a table. Next step flow automatically insert a for each loop for getting all the records.

 

image.png

 

 

If you are dealing with a CSV file then you might need to use a third party connector

 

https://medium.com/plumsail/how-to-parse-a-csv-file-using-microsoft-flow-azure-logic-apps-or-powerap...

 

Also this blog might helpful

 

https://sharepains.com/2020/03/09/read-csv-files-from-sharepoint/

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials

View solution in original post

4 REPLIES 4
Super User III
Super User III

Hi @NeighborGeek 

 

If you looking to read the excel contents then you need to use List rows present in a table. Next step flow automatically insert a for each loop for getting all the records.

 

image.png

 

 

If you are dealing with a CSV file then you might need to use a third party connector

 

https://medium.com/plumsail/how-to-parse-a-csv-file-using-microsoft-flow-azure-logic-apps-or-powerap...

 

Also this blog might helpful

 

https://sharepains.com/2020/03/09/read-csv-files-from-sharepoint/

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials

View solution in original post

Thanks, I think that gives me enough to go on.  I'm trying the 'list rows present in table' action now.  I didn't realize at first that I had to create a table in excel to read it in, I was just pasting a list into column A of a spreadsheet and saving it, but apparently I need to explicitly create a table and name it in order to use this action.  

 

I'm going to keep working on this path just to learn how to do it, but it may not be the best option.  What would you recommend as a better way to get the list of addresses (or any string values) for my flow, rather than having them saved into a file and retrieving them from there? 

There's no need to store the list after it's processed, so even something as simple as a form that the user pastes the list into, or a manual flow that prompts for the list somehow, would be fine.  I just don't want to make them enter individual numbers, since they're copying the list of numbers from somewhere else already it's easier to just paste the whole list.  

Hi @NeighborGeek 

 

There are different ways you could do this. You could create a manual flow with some input parameters. If you want to use one parameter with comma separated then you need to use a split expression later in your flow actions to get individual details. I could do a screen share with you tomorrow.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials

Oh, wow.  Thank you for the offer, but that's really not necessary.  I just wondered what someone more experienced, starting from scratch instead of trying to replicate an existing process, might do differently.  The good news is that I did get the flow working using a text file and the link you shared about pulling from a csv, so I have a working flow now that we can start using, even if the process of getting the addresses to send to is a little kludgy.  It's still better than what we had, just removing the dependency on a vpn connection to access the network share will be a big help.  

 

Thanks!

Helpful resources

Announcements
New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (108,023)