Updating Rollup Fields in Model-Driven Apps - Design and Implementation

Updating Rollup Field with CalculateRollupField Function - Solution for PL-600 Exam

Question

A company has a model-driven app with the rollup field of the "Total estimated revenue" of open opportunities for the account.

The company wants to recalculate the value of this column whenever open opportunities change in a system.

Therefore, it is considering using an API call to CalculateRollupField Function.

The function takes the table name, the record identifier, and a column name.

The company invites you to design and implement the solution.

What two items will you use in your design to update the rollup field?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D. E.

Correct Answers: B and D

Microsoft Dataverse provides special column types for calculations and data aggregation.

These types are Calculation and Rollup.

The Calculation column allows users to define a formula based on the column value.

This type includes columns from the same table and related parent table in a many-to-one relationship.

Calculated columns are read-only.

Users benefit from a list of built-in functions for the calculated values and operate on the different data types like text, numeric, and date-time.

The calculations run synchronously when a record is saved.

The Rollup column is like the Calculated type.

They operate only with the numeric (Whole Number, Decimal Number, and Currency) and date-time datatypes.

The Rollup type includes columns from the same table and related child tables in a one-to-many relationship.

The list of built-in functions for the Rollup column is smaller compared to the Calculated columns.

It includes sum, min, max, and count.

Rollup columns are read-only.

By default, the calculations for the Rollup column run once per hour.

Users can change the frequency in Customization settings for the table, but the minimum is one hour.

It is an asynchronous operation.

Suppose you need to update a rollup column when some related rows are updated.

Dataverse provides an API CalculateRollupField function that can calculate the column on demand.

You need to create a custom connector with the call to this API function and use this connector with Power Automate flow.

In Power Automate, you create an automated flow triggered by the Dataverse "When a row is added, modified or deleted" and calling the custom connector with table and column parameters.

The custom connector calls the function.

And the function will update the rollup column.

All other options are incorrect.

For more information about The Dataverse rollup columns, please visit the below URLs:

To update the rollup field of the "Total estimated revenue" of open opportunities for the account, we need to design and implement a solution that recalculates the value of the column whenever open opportunities change in the system. This can be achieved by using the CalculateRollupField function via an API call.

To implement this solution, we have several options to choose from. Let's look at each of the options and their applicability to the scenario:

A. Azure Function: Azure Functions can be used to create small, single-purpose functions that can be triggered by events such as changes to a database record. We can use an Azure Function to trigger the CalculateRollupField function when an opportunity record is updated. The Azure Function can be written in a language of our choice and can be hosted on Azure. This solution requires some programming expertise to implement.

B. Power Automate: Power Automate (formerly known as Microsoft Flow) is a cloud-based service that allows us to create automated workflows that can integrate with various applications and services. We can create a workflow in Power Automate that triggers when an opportunity record is updated and calls the CalculateRollupField function to update the rollup field. Power Automate provides a no-code solution for implementing this scenario.

C. Webhook: A webhook is a way for an application to notify another application when a particular event occurs. We can create a webhook that triggers when an opportunity record is updated and calls the CalculateRollupField function to update the rollup field. This solution requires some programming expertise to implement.

D. Custom Connector: Custom connectors provide a way to connect Power Apps and Power Automate to external systems that do not have pre-built connectors. We can create a custom connector that calls the CalculateRollupField function and use it in our Power Apps or Power Automate workflow to update the rollup field. This solution requires some programming expertise to implement.

E. Azure Service Bus: Azure Service Bus is a messaging service that allows us to decouple applications and services by using asynchronous messaging. We can create a message queue in Azure Service Bus that triggers when an opportunity record is updated and calls the CalculateRollupField function to update the rollup field. This solution requires some programming expertise to implement.

Based on the scenario, the best options to use in our design to update the rollup field are:

  • B. Power Automate, which provides a no-code solution for implementing this scenario.
  • D. Custom Connector, which provides a more customizable solution than Power Automate and requires some programming expertise to implement.

Overall, the solution to update the rollup field will depend on the specific needs of the organization, the level of customization required, and the technical expertise available to implement the solution.