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

Flow Design: "Regenerate" a SP list every time a new file appears in OneDrive using that File for the Data

Hi,

 

I am struggling to design this process though I believe Flow is best suited to help me with it. My organization uses an external system which I cannot directly link to SP or Flow for querying purposes. Instead, I am able to manually run reports at will, which I can download into a csv.

 

I am fine with doing this part, however due to the size of the data exported, generating uniform reports from the CSV data is highly difficult. I would like to be able to utilize a combination of Flow and SP to manage this data as often as I export it. I need Flow to either delete the entirety of the existing SP List content each time the flow is run, OR (and I imagine this is more difficult if not impossible), detect what rows still exist and leave them intact on the existing SP List while deleting all the others and adding any new rows as detected from the CSV file. I think simply "refreshing" the SP list is easiest, and I have no need for preserving the data of a prior week in this case.

 

I am electing to utilize a SP list as opposed to the CSV or an excel sheet because I am then running multiple other button flows which query the list and generate documents or emails with the filtered data. I am also favoring SP as I plan to enable other users to interact with these flows inside of a SharePoint site itself, allowing them to run the same reports I am.

 

My issue presently is how to best handle the "reset" of the SP list each time I want to import a new CSV. Is it best to delete the list outright and instruct flow to create a fresh list? Is deleting an entire list possible in Flow? Can I build the flow to batch delete potentially thousands of rows in a SharePoint list, or is there a limit I will hit?

 

Apologies in advance for the length and lack of focus on this post. I appreciate any direction.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Flow Design: "Regenerate" a SP list every time a new file appears in OneDrive using that File for the Data

Hi @natsch ,

 

Do you want to delete the list through Flow or delete all the items in the list?

If you want to delete the list, you could use Send HTTP request to SharePoint to delete the specified list using REST API.

First get the GUID of the specified list through Get lists action, and then configure it in Uri.

Image reference:

1.PNG

If you want to delete all the items in the list, please refer to the following configuration:

2.PNG

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 REPLIES 2
Community Support Team
Community Support Team

Re: Flow Design: "Regenerate" a SP list every time a new file appears in OneDrive using that File for the Data

Hi @natsch ,

 

Do you want to delete the list through Flow or delete all the items in the list?

If you want to delete the list, you could use Send HTTP request to SharePoint to delete the specified list using REST API.

First get the GUID of the specified list through Get lists action, and then configure it in Uri.

Image reference:

1.PNG

If you want to delete all the items in the list, please refer to the following configuration:

2.PNG

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
natsch
Level: Powered On

Re: Flow Design: "Regenerate" a SP list every time a new file appears in OneDrive using that File for the Data

Hi @v-bacao-msft,

 

Thanks very much; my apologies for not doing my due-diligence to note the REST API access with flow. I have since reproduced the solution you suggested and it worked perfectly as expected. Thanks for your help.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 244 members 5,298 guests
Please welcome our newest community members: