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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

How to build automation on opportunity during different Opportunity stages based on different option set values from Contact?

(1) ShareShare
ReportReport
Posted on by 150

Hello,

I am trying to build automation on opportunity using different set option field values that are defined in the entity 'contact' such that during different opportunity stages, it'd fetch the value from 'contact' accordingly and show it in the status reason field on the form in the following manner:-

1. Discovery stage of opportunity --> 1. SQL

2. Closed won --> 2. Customer

3. Closed Lost --> 3. Lost

4. Lead --> Qualified / Meeting Booked.

How to do this or perhaps achieve this?

I have the same question (0)
  • Suggested answer
    Jacob.s17 Profile Picture
    464 on at

    Hi Jimxmy,

    I need to restate your question to confirm I understand what you're asking.

    SQL, Customer, Lost, Qualified / Meeting Booked are all on the Contact entity in an option set.  You then want to fetch this value and show it in the status reason on the Opportunity as the Opportunity moves through the stages? This to me doesn't make sense, because the Contact option set wouldn't change....

    Did you mean to say you want the Contact's option set to change as the Opportunity moves through the stages? because this makes more sense to me. Basically if the Opportunity is won, the Contact becomes a "Customer," if it's lost they become "Lost," and if it's in the first stage of Lead then we flag the Contact as "Qualified / Meeting Booked."

    If this is what you're asking then its quite simple. Create a workflow on the business process flow that writes the "stage name" to a text field on the Opportunity it is attached to. Then a workflow on the Opportunity to update the Contact based on the stage name. There you'll house the logic that says if stage name = "Closed as Lost" then Contact is "Lost"

    alternatively if your stages sound a lot more like a mix of statuses and stages, and even a different entity. If that's the case you need to consolidate the logic into a more concise system, like the stage names I suggested, or just use Status Reason for your "stages."

    I hope you found this helpful, let me know if I missed the mark.

  • jimxmy Profile Picture
    150 on at

    Hi Jacob,

    So the later part is what I exactly want since you have described it correctly. Regarding your steps on how to proceed ahead with this, would you please elaborate on it step by step and how to create a workflow and on which specific entity. I'd appreciate it much. Thank you.

  • Verified answer
    Jacob.s17 Profile Picture
    464 on at

    Because Won and Lost are statuses, and Lead is a different entity, and SQL is the only step that is truly a stage... let's try to come up with something easier since you aren't really using "stages" as they are defined in a business process flow.

    Firstly, setup your Option Set on the Contact entity. Let's called it Relationship Status (there's a default Relationship type but I'll leave that to you to decide whether or not to re-purpose it)

    - Relationship Status

    1. Lost Prospect
    2. Customer
    3. SQL
    4. Qualified Prospect

    Now let's get the Status portion out of the way.

    Workflow 1: Update on Status change
    Entity: Opportunity
    Trigger: On Status Change, On Create
    Logic:

    1. Check Condition
      1. IF Customer (Contact) Relationship Type does not equal Customer
      2. THEN Check Condition
        1. IF Status = Won
        2. Update Record (Contact)
          1. SET Relationship Type = Customer
      3. Conditional Branch
        1. IF Status = Lost
        2. Update Record (Contact)
          1. SET Relationship Type = Lost Prospect
      4. Conditional Branch
        1. IF Status = Open
        2. Update Record (Contact)
          1. SET Relationship Type = Qualified Prospect

    note: If a Lead is qualified to an Opportunity and a Contact is created this will automatically set your Contact's Relationship Type to "Qualified Prospect". The check condition at the start is to ensure you're not changing a customer's relationship type just because they have a new opp, or lost one recently.

    before we do workflow 2 I have to ask, how are we identifying that we're in discovery? can we make it a new field, call "in discovery" like a checkbox on the Opportunity? I don't want to go into stages and workflows on business process flows if we're just writing 1 single stage name. If that's ok, see below, also this would be the easiest way.

    Workflow 2: In Discovery, Update Contact
    Entity: Opportunity
    Trigger: On fields change (check off the proposed "In Discovery" field)

    1. Check Condition
      1. IF Customer (Contact) Relationship Type does not equal Customer
      2. THEN Check Condition
        1. IF In Discovery = Yes
        2. Update Record (Contact)
          1. SET Relationship Type = SQL

    If you have your heart set on redefining your business process flow into a stage like process with updates such as, New Lead -> In-Talks -> Nearing Deal -> Customer (if won), and Lost Prospect (if lost) then we can talk about creating a workflow off your Business Process Flow instead.

    Let me know, and mark as the suggested answer if you like the approach I provided with the 2 workflows.

  • jimxmy Profile Picture
    150 on at

    Hi,

    I have set my option set on the 'contact' entity and placed the field on the header section of the form as well as named it as 'Lead Status.'

    Now regarding your workflow 1,

    in your step:

    1. Update Record (Contact)

    2. SET Relationship Type = Customer

    I am able to add the steps until 'update the contact' like this : 

    3731.Capture1.PNG

    But not sure how to set the Relationship Type to Customer using the set properties button:

    7180.PNG

    Also, I can't see the Lead Status field that I have defined either. 

    Any possible issue here?

  • Jacob.s17 Profile Picture
    464 on at

    Hey Jim.

    So you're updating the relationship type or your custom option set called "Lead Status?"

    Either way if you don't see it at the top, check down below in the "Additional Fields" section of the Contact Set Properties area.

  • jimxmy Profile Picture
    150 on at

    Hi, 

    Greetings.

    I have managed to finish the first workflow but the second workflow is not really working.

    1. When the opportunity is open and then If I select the checkbox to set it as 'Yes', after saving the form, the lead status does not change to 'SQL', the status still stays as 'Qualified /Meeting Booked.'

    Is the workflow 2 conflicting with workflow 1 because of the opportunity status as 'Open'? 

    Any possible leads to this would solve the whole issue for me. Thanks in advance. 

  • Jacob.s17 Profile Picture
    464 on at

    Well the trigger is on Create and Status change to set to Open, Won, or Lost so the update of a field shouldn't affect trigger workflow 1. You could turn on Audit History to check it out.

    Did you check your "process sessions" in the workflow to confirm the logic is firing?

  • jimxmy Profile Picture
    150 on at

    Hi.

    Checked the "process sessions" to confirm and no, the logic is not firing upon the selection of checkbox. I have made sure to follow the correct process for the creation of workflow process.

  • Jacob.s17 Profile Picture
    464 on at

    I just read someone else who had the same issue and tried 3 things.

    1. Set as on demand and see that it updates correctly when manually run

    2. Convert to a real-time workflow and see if it works

    3. Convert back to a background workflow (something about going real-time to background helped one person out)

  • Suggested answer
    Jacob.s17 Profile Picture
    464 on at

    4. Just found someone who put in a conditional branch that is set to "Stop Workflow" if the field = No.

    community.dynamics.com/.../workflow-not-working-on-field-change

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 182 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 123

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans