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

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
Highlighted
Community Support
Community Support

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.

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

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.

View solution in original post

Highlighted
Regular Visitor

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

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

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

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Top Kudoed Authors
Users online (6,665)