Customer Engagement & Dynamics CRM Forum

Expand all | Collapse all

Flow that fills fields on opportunity products upon creation

  • 1.  Flow that fills fields on opportunity products upon creation

    Posted 20 days ago

    Currently, my organization uses opportunities and opportunity products. Each opportunity product is assigned a due date and an estimator, which is a user within the system. I have been asked to create a flow that will check if a previous opportunity product has been saved on a given opportunity and then will fill the new opportunity product that is being created with the estimator and due date that exists on the first created opportunity product. I am definitely a beginner and self taught, so I am spinning my wheels regarding how I would kick this off. I am hoping someone has done something similar or possibly could give me more information about my situation and need.


    Corinne Perry
    360 Sheet Metal Products
    Academy - Online Interactive Learning from Experts

  • 2.  RE: Flow that fills fields on opportunity products upon creation

    Posted 20 days ago
    Hi @Corinne Perry,

    It sounds like they would like these fields to be auto-filled when the Opportunity Product recor​d is created - not after the record is saved. If that's the case...

    • Using CRM workflow you can accomplish this with a "real time workflow". Unfortunately this is not available in Power Automate at this time.
    • You can also look at using Business Rules for this.
    • Or, worst case, you can use JavaScript.
    Because you have to check to see if another Opportunity Product already has an Estimator and Due Date associated, you're going to have to navigate parent/child relationships to get the data. That get's tricky with any of the above approaches (I believe it is likely impossible with Business Rules).

    Or here's another idea:

    1. On the opportunity entity, create these fields (or whatever names make sense):
      1. Default Estimator
      2. Default Opportunity Product Due Date
    2. Map these fields to the Opportunity Product entity
      1. Now, whenever someone adds a new Opportunity Product to an Opportunity, it will use these default fields
    3. Setup a flow that writes the fields from an Opportunity Product BACK to the parent Opportunity IF they are blank on the Opportunity
      1. Now, if the user doesn't set the default values on the Opportunity entity, the workflow will do it for them - and all future Opportunity Products will use those fields

    This may not be 100% perfect because if a user doesn't have the defaults set, and quickly adds several Opportunity Products to an Opportunity, the defaults may not get set quickly enough (since the flow may take a few minutes to do the update) to populate the fields. You could resolve this through any of the following options:
    • Make the default fields required on the Opportunity
    • Make the "flow" in #3, above, a CRM workflow - and make it real-time
    • Setup a second flow that runs after and Opportunity Product is saved and checks the parent Opportunity to see if the default fields are now populated and - if so - populates them back on the Opportunity Product (not a great solution because the flows may still not run in the right sequence, and there may be some cases where the user wishes for these fields to remain blank)

    Geoff Ables
    Managing Partner
    C5 Insight
    Charlotte NC

    Academy - Online Interactive Learning from Experts

  • 3.  RE: Flow that fills fields on opportunity products upon creation

    Posted 19 days ago
    I think this would work in Flow:
    - Create an Automated Flow that is triggered by the creation of an Opportunity Product
    - In the Flow, the main steps would be to 1. Trigger upon record creation, 2. Get the existing Product from the Opportunity (you will have to feed it the GUID from the Opportunity), 3. Update the new Product with data from the existing Product

    I think the trickiest thing here is if you have more than one Opportunity Product already, how do you choose which one to grab data from? You could set up a numbering system on your Opportunity Products (1,2,3,4,5...) and then track the max one through a rollup field...or you could use a condition step and some other logic in your Flow to find the max Opportunity Product on that Opportunity either using this numerical field or perhaps just the date on the record.

    Terry Letkeman
    Bespoke Technology Services

    Academy - Online Interactive Learning from Experts

If you've found this thread useful, dive deeper into User Group community content by role