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

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

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

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (8,093)