web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

avoid infinite loop with 2 Workflows

(0) ShareShare
ReportReport
Posted on by 8,270

Hi guys,

I've created a WF that updates a text based on a lookup. But also a WF that updates the lookup based on a text. This is for a Marketo integration, so I must do it. This could be for any of my custom entities (Country, Industry, etc.). 

Here the set up:

  • TextA is hidden field. It is only updated by a Marketo integration, or the 2nd WF.
  • LookupA is a Lead field that can be manually updated or by the 1st WF
  1. WF is triggered by TextA. It reads TextA and updates LookupA.
  2. WF is triggered by LookupA. It reads LookupA and updates TextA.

So when a user manually updates the LookupA on the Lead, it will trigger 2nd WF and update the TextA. But it will trigger 1st WF which then updates again (via WF this time) the LookupA.

Is there a way to AVOID this?

Maybe if the LookupA or the TextA already have the new value, it can ignores the update? Is there a way to compare OLD vs NEW value?

Thanks guys!

Regards,

Raúl

*This post is locked for comments

I have the same question (0)
  • Verified answer
    ashlega Profile Picture
    34,477 on at

    Is there a special user for Marketo integration? You might check "modified by" field in the workflows that's attached to TextA before doing anything (if "modified by" == "marketo integration user" then stop)

    I'm guessing you might also create an extra field which would only be set from Marketo integration and configure the workflows that's attached to TextA to run on that field instead. In that case, when a lookup is updated, your lookup workflow won't be setting that special field, so the second workflow won't be starting

  • Verified answer
    Community Member Profile Picture
    on at

    Agree with Alex, You can check the integration user or use a field which you can set through JavaScript or business rule when the change is made via UI and check the same in the Workflow.

  • Verified answer
    PS Profile Picture
    23,577 on at

    Add a condition in both the workflows. This would be the first condition and then update.

    In my case I have taken example of Lead Topic field and Opportunity Topic (renamed to objective in my crm) field. Originating lead is the lookup on opportunity:

    Add: Originating Lead 'Topic' does not equal Opportunity 'Topic'

    6563287.1.JPG

  • Verified answer
    prt33k Profile Picture
    6,907 on at

    You can handle it in two ways:

    1) Put a check in data. If the data that you are going to update is already present then skip the update. This is similar to what Prashant suggested in above post.

    2) Put a check on initiating user. So in you case the TextA gets updated my Marketo Integration which I believe runs under some service account. So when the modifying  account is service account only then we Update the Lookup. And we update the Text on lookup change only when the initiating account is Not service account. This will require a custom workflow/plugin though.

    Thanks,

    PS

  • RaulOcana Profile Picture
    8,270 on at

    Thanks guys.

    I did all validations. Modified By and old vs new value!

    Thanks!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans