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

Speed Up Flow when Adding items to List

Need help on what direcition to take this flow.

 

jackp514_0-1617122261577.png

 

I am setting a timer to to pull our Work Orders from our ERP software using API Requests every hour. If the Status of the work order is set to "Billed" then I add it to a SharePoint list. 

 

Pulling 13,000 work orders every poll, 12,000 in billed status. Did a big run to get all the historical data so my list is populated correctly now. But now every run, flow is having to check through all records and fail out due to duplicate WO IDs in the SharePoint list just so I can add the one or two newly completed work orders.

 

What is the better way to handle this? Even with flow set to 50 concurrent runs it takes over 3 hours for the flow to complete.

 

jackp514_1-1617122481039.png

 

How do you filter down the array to only the new work orders before I start the "Create new item" step.

4 REPLIES 4
abm
Super User
Super User

Hi

 

Can you get the status billed ones only from the API?

 

Also you mentioned "But now every run, flow is having to check through all records and fail out due to duplicate WO IDs in the SharePoint list just so I can add the one or two newly completed work orders." 

 

Can't see the above logic from your screenshot? Could you please explain?



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
jackp514
Frequent Visitor

No unfortunately the API has no filtering capabilities of its own. Best I can do is query all work orders.

 

Also, to explain further, I have the option set on the SharePoint list "Do Not Allow Duplicate Values" on the primary column which is "Work Order ID#"

 

So I'm relying on the SharePoint list to reject all items and only add new ones. 

Hello @jackp514 

You could count the number of items returned by the API call and the number of items stored in your SharePoint list. If the number of items returned by the API call is greater that the number of items stored in your SharePoint list, it means there are new items, so you could get the most recent items and create them in SharePoint list.

This would work assuming that the API returns the records always in the same order. Is that possible?

Regards,

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!
jackp514
Frequent Visitor

I like this train of thought. Would get me a little closer. Let me go back to the API and see how it is ordering data.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (1,947)