I am hitting a throttle limit on a Power automate that runs and pulls information from Dynamics 365. The flow already takes an hour to run if I put in a delay it is going to make it worse. Any suggestions on how to make this more efficient and not hit throttle limits. Below is my For each loop. I do a few look up to two different SP List and that is where I am hitting the limit. I am just not sure how else to do the lookups because I need the information in those list. Basically I am pulling all the vendors from MSD and then checking if it is in the SP List if Yes Update if No create.
Any help not to hit the limit would be appreciated.
I was able to remove all the compose statements and the other for each loop on update which resolved the throttling issues. The client is not deleting vendors out of MSDX (That is what they said will need to confirm) I do have a flag if they put the vendor "On Hold" can do not show them if they are "On Hold".
I do like the trigger coming from Dynamics not every four hours. I will talk to them about that possibility.
Thank you for all your help
OK, now I understand a little more. Here are some additional questions.
How do you manage if an entry in your list was deleted? You don't have any step to delete items that are in the vendors list but not longer in the Dynamics table.
How do you manage new entries in the lookup table/list?
What logic is in the compose steps?
What else did you change from the first screenshots? It looks like "Get legal entities" is also in an "Apply to each".
If you want to sync the table maybe it would be better to create a trigger that checks if an item is created, modified or deleted. In that case you would immediately have a sync and not wait for the scheduled job.
But of course you can also do it your way to always sync everything. In that case I would suggest that you only search and sync data that is really needed to be synchronized. You could load the complete sharepoint lists and compare it to the dynamics tables. I think this would be possible with only one select action.
So in my opinion it is possible to shorten the flow from 10000 of actions to only a view. But to do this you would have to rebuild it. If this is too much challenge we could of course also have a look at the other steps inside the loop and I'm sure it is possible to get rid of some of them without changing the current logic.
Based on what you said I was able to removed the substring function.
The Legal Entities list has 100 items in it. The Vendors list has the same number as the Dynamics table. I am essentially trying to keep the list in SP and Dynamics the same.
Below is more detail on the other steps
How many items are in those lists? Please provide information about the other steps and sample data would help a lot. For example you could get rid of more than 2000 actions in your flow if you delete that substring step and put a the substring formular into that second sharepoint step. But I'm pretty sure you could also delete some other actions.
So the Vendors list is tied to another list by a lookup called legal entities. What I am doing in that step is getting the Legal Entity Item by doing a get items. I am posting an expanded view of those other two get items. The Get vendors is inside the loop because the power automate is comparing the vendors from Dynamics to the vendors in the Sharepoint list and if there is a vendor in the SP list it updates the list if there is not one it created it in the SP list.
Thank you for taking a look
Respectfully
Jennifer
Hello @JECKARD007
for me it is not enough information to help. What is “compose 2”, why is “GetVendor” i side the loop. What are all the other steps doing?
Can you provide some sample data.
if you do actions inside a loop they are multiplied. So of course you get throttled soon.
I think with some adjustments the flow will run much faster and not get throttled.