Skip to main content
Best answer

Race condition for new list items in SharePoint

  • September 4, 2024
  • 1 reply
  • 46 views

Hi team

 

I have a Zap that triggers on SharePoint New Item:

 

 

I assume that poll will pull any new items created within the last 2 mins and runs this zap. The issue I am having is that within those 2 mins, I have multiple (2) new items so multiple instances of this zap is executed. For argument sake, let’s call the new items I am creating Contacts.
 

This is a problem as within that Zap, I create an Engagement within my CRM that both contacts belong to. What the zap is doing is creating the engagement twice as it’s running, assumably, at the same time.

I tried to add a step in the zap to check if the engagement is created yet and if so, don’t create, just update with the second contact, but I find this is working sometimes, not all the time. 

How do I best manage this race condition?

I added a delay for 1 min but I then thought .. if both zaps are running the same time and delay for the same amount of time, it wont fix my problem.

Any help is appreciated!

Best answer by SamBBest answer by SamB

Hi @Steven Ton, welcome to the Community! 🎉

You were on the right track with delay! It has a Delay After Queue option that should help with this. With that type of delay it would create a queue of actions to run at a later time so that they don’t attempt to create/update the contact at the exact same time. You can learn more about this here: Delay after queue

Hope that helps to get you pointed in the right direction. If you run into any issues on that or have further questions just let us know!

View original
Did this topic help you find an answer to your question?
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

SamB
Community Manager
Forum|alt.badge.img+11
  • Community Manager
  • 7472 replies
  • Answer
  • September 4, 2024

Hi @Steven Ton, welcome to the Community! 🎉

You were on the right track with delay! It has a Delay After Queue option that should help with this. With that type of delay it would create a queue of actions to run at a later time so that they don’t attempt to create/update the contact at the exact same time. You can learn more about this here: Delay after queue

Hope that helps to get you pointed in the right direction. If you run into any issues on that or have further questions just let us know!