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

Community site session details

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

Rollup field filter on top source entity

(1) ShareShare
ReportReport
Posted on by 22

Hi there,

I have an issue where I want to build a conditional rollup field on the Opportunity with the filter field is a Lookup on the Opportunity Product. I understand you can't use a Lookup field as a filter on the rollup field formula, but i wanted to know if there were any workarounds?

I thought creating a field on OpportunityProduct and using a workflow to push the data from the Lookup field to a Text field (which would be used as the filter in the rollup formula) might work, but the workflow builder doesnt allow me to push data from two fields on the OpportunityProduct entity?

Also, I keep reading that a rollup formula can filter on the source entity just like it can on the target entity - I cannot seem to get it to access the source entity (Opportunity) field as filter fields, only the OpportunityProduct. Is this true?

Any thoughts greatly appreciated.

Thanks,

Andrew

I have the same question (0)
  • Suggested answer
    ba365guy Profile Picture
    2,948 on at
    RE: Rollup field filter on top source entity

    Hi

    Please use the parameter called "Scope".

    When we select the scope as Organization, then the flow will trigger for all users of D365.

    When we select the scope as Parent: Child Business Units, then the flow will trigger only for the Users who are under the subordinate business units of the Flow execution context User’s Business Unit.

    When we select scope as Business Unit, the Flow would trigger for all users of the same business unit. Same business unit means, the Flow execution context Users’ Business Unit.

    When we select scope as User, it would trigger Flow only for a single user who is Flow execution context User.

  • ba365guy Profile Picture
    2,948 on at
    RE: Rollup field filter on top source entity

    Can you initiate a new thread please.

  • Community Member Profile Picture
    on at
    RE: Rollup field filter on top source entity

    Thanks ba365guy. I have created these flows in PowerAutomate under 'My flows' with scope set to 'Organisation'. Does this mean that I have created a personal flow which impacts on all users? This does not seem right to me.

    If not, if I want to roll these out across all users, do I need to recreate these under 'My Teams'?

  • Suggested answer
    ba365guy Profile Picture
    2,948 on at
    RE: Rollup field filter on top source entity

    Hi Andrew,

    Workflow is not supported for such functionality. 

    Only Power Automate can do. 

    Otherwise you need to go ahead with custom plug-in (C# coding) or Javascript coding

  • Community Member Profile Picture
    on at
    RE: Rollup field filter on top source entity

    Hi ba365guy,

    While we have this working (which is great) and I'm keen to implement across the organisation, I just wanted to know if there were any other means of making this work (taking a copy of the text label of the value in the Lookup field and moving it to a simple text field), perhaps via D365 workflow?

    Thanks

  • Andrew Stone Profile Picture
    22 on at
    RE: Rollup field filter on top source entity

    I'll start a new thread, thanks

    My understanding of the video/information is that CDS looks for the status of the record as a filter (If status of record = resolved, then update).

  • Suggested answer
    ba365guy Profile Picture
    2,948 on at
    RE: Rollup field filter on top source entity

    May i know why are you looking for statecode

    Based on my previous understanding, you should be looking for existing product (or product id)

    If it for a new doubt.... Would you mind starting a new thread (only for new doubt, else ignore)

  • Andrew Stone Profile Picture
    22 on at
    RE: Rollup field filter on top source entity

    The drop down mentioned above does not contain any 'statecode' equivalent as far as I can see?  Looking at the D365 information on the OpportunityProduct, the relevant field seems to be 'Opportunitystatecode' but this is not available? 

    pastedimage1578278933427v1.png

  • Suggested answer
    ba365guy Profile Picture
    2,948 on at
    RE: Rollup field filter on top source entity

    Click on "Use rich formatting"

    You can paste images.

  • Andrew Stone Profile Picture
    22 on at
    RE: Rollup field filter on top source entity

    Thanks ba365guy.

    I've read through the article/video in the link regarding the UPDATE using CDS. I dont believe there is an equivalent 'statecode' field in on the OpportunityProduct entity I can use to replicate the logic?

    I have created a new flow, triggered by the CDS 'when a record is updated' trigger, with entity name = opportunity products and Scope = org. The attribute filters item field does not contain any such status field?

    The rest of the flow uses D365 steps in the original (working) flow.

    Not sure if there is a workaround?

    How can I paste screenshots into these text boxes?

    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…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Hamza H Profile Picture

Hamza H 141

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 132

#3
DAnny3211 Profile Picture

DAnny3211 130

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans