cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper V
Helper V

Is there a way to calculate totals in model-driven apps?

Hello I am trying to get the sub total of a bunch of entities that have a many-to-one relationship with another entity. I was able to get this to work in a canvas app through the use of filtering and Sum() but don't know if it is even possible with model-driven apps. I first thought of using a Flow but then see that there's no way to send data back to a model-driven app the same way I can with a canvas. 

 

model-driven-app.png

 

Is this possible with model-driven apps or should I just stick to canvas?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Is there a way to calculate totals in model-driven apps?

Hi @Mgodby ,

 

If you want to sum the total field from child entity, you can create a Roll-up field to calculate the aggregation.

The rollups are calculated by scheduled system jobs that run asynchronously in the background. The asynchronous job executes once per hour, attempting to recalculate the rollup attribute. In additional to the hourly system job, users may manually force a system recalculation.

Note: You should have write access on parent entity 

Snipaste_2019-11-25_18-02-26.png

Snipaste_2019-11-25_18-10-37.png

Best regards,

Sik

View solution in original post

2 REPLIES 2
Highlighted
Helper I
Helper I

Re: Is there a way to calculate totals in model-driven apps?

Roll-up fields allow you to sum fields on a one-to-many entity, but those only recalculate every 12 hours, so if you want to see it updated immediately, they're not ideal. (They do have a refresh button attached to the field, which the user can click to force it to recalculate, but you probably don't want to expect the user to do that).

If you can write JavaScript, you could create a Web Resource with a method that pulls in the data, sums it, and fills in the field with the summed value.
Highlighted
Community Support
Community Support

Re: Is there a way to calculate totals in model-driven apps?

Hi @Mgodby ,

 

If you want to sum the total field from child entity, you can create a Roll-up field to calculate the aggregation.

The rollups are calculated by scheduled system jobs that run asynchronously in the background. The asynchronous job executes once per hour, attempting to recalculate the rollup attribute. In additional to the hourly system job, users may manually force a system recalculation.

Note: You should have write access on parent entity 

Snipaste_2019-11-25_18-02-26.png

Snipaste_2019-11-25_18-10-37.png

Best regards,

Sik

View solution in original post

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (1,894)