Quantcast
Channel: Dynamics Communities
Viewing all articles
Browse latest Browse all 940

Working with Rollup Fields in Dataverse

$
0
0

Rollup fields are a sort of magical column that performs math out-of-the-box. It allows you to aggregate using any of the following functions:

  • Sum
  • Count
  • Min
  • Max
  • Avg

I use rollup fields to do things like create a count of all opportunities on an account or a sum of actual revenue all won opportunities for an account. You can also use calculated fields in your rollup calculations.

Rollup fields will be calculated asynchronously, which means it will not update in real-time. They are controlled by a scheduled system job that runs once an hour in Dataverse. Your users can also manually recalculate any rollup field in their app.

Fun Fact: Your System Administrator can schedule these system jobs to run as often as needed! You can learn more about where to manage this here.

Once you have created a rollup field, you can use it anywhere: on forms, in system views and as a data point on your charts, dashboards and reports.

How to Create a Rollup Field

Let’s walk through a business scenario: the count of All Opportunities should be listed on the Account Form. This should count every Open or Won opportunity, but not Lost.

Creating a rollup field is simple and can be done directly in the column creation screen.

1. In make.powerapps.com, in our solution file, add a new column under the Account table.

A screenshot of a computer Description automatically generated

2. Add a new column called Number of Opportunities as a Whole Number field. Make sure to set Behavior to Rollup. Click Save at the bottom. This will save the field to Dataverse and then open a new window to enter your rollup criteria.

A screenshot of a computer Description automatically generated

3. In the new window that opens, you will add the following:

  • Related Entity = Opportunities (Potential Customer).
    • Note: Several Account:Opportunity relationships will appear. It’s important to select the correct entity/table relationship to get the expected rollup function!
  • After saving the entity, FILTERS will appear on the Related Entity. For this example, we want to add a FILTER of Status = Open or Won. This will exclude LOST Opportunities from the count.
  • Under Aggregation, select your Aggregate Function (for this example, we selected COUNT) then which field it should pull from (for this, Opportunity).

4. After all items have been configured, click SAVE or SAVE AND CLOSE at the top:

A screenshot of a computer Description automatically generated

Now, your Rollup field has been created and configured and is ready to be added to your form, system views, dashboards and more!

A screenshot of a computer Description automatically generated
A screenshot of a computer Description automatically generated

Limitations with Rollup Fields

Let’s review some of the limitations with rollup fields. For the full list, check out this Microsoft Learn article.

  • A workflow cannot be triggered by rollup field updates.
  • There is a maximum of 10 rollup fields per table.
  • There is a maximum of 100 rollup fields for your organization.
  • A rollup over a rollup field is not supported,
  • A rollup cannot reference a calculated field that uses another calculated field.
  • A rollup cannot be done on a N:N relationship.
  • A rollup cannot be done on the 1:N relationship of the Activity or Activity Party table.

The post Working with Rollup Fields in Dataverse appeared first on Dynamics Communities.


Viewing all articles
Browse latest Browse all 940

Trending Articles