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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Creating a total from ...
Power Apps
Unanswered

Creating a total from records within a nested gallery and displaying in a field outside o nested gallery

(0) ShareShare
ReportReport
Posted on by 467

Hello, I have a requirement to create a total within a header that totals the Price field that is located within a nested gallery, Gallery in a gallery design.  Everything else seems to be working as expected however it does not seem like the allitems has values similar to how the data has values within the nested gallery.  So this worked fine in the first design where everything was in a single gallery however once seperating and impelmenting nesting, grouping, etc. the total no longer works and just displays blank as I don't believe there are any values in the allitems with the nesting.  Any assistance with this would be greatly appreciated.

 

Here are my forumulas.

 

Main gallery - WBSCartGalleryFlexible

Items - Sort(GroupBy(AddColumns(Sort(Filter('WBS-Carts','Cart Header'.'WBS-Cart Header'=GUID(Param("recordId"))),Name,SortOrder.Ascending),"CartGrouping",Grouping.Name),"CartGrouping","Data"),CartGrouping,SortOrder.Ascending)

 

Nested Gallery - Gallery2_2.AllItems

Items - ThisItem.Data

 

Total Field located in the Canvas App header, not located in any o the galleries. 

Concatenate("Total", " ", "$", Sum(Gallery2_2.AllItems, RoleRateCart_1.Value))

Categories:
  • BCBuizer Profile Picture
    22,899 Super User 2026 Season 2 on at

    Hi @Dudditz ,

     

    In case of nested galleries, the reference to the nested gallery in the Sum function will not work because you don't define which instance(s) of the nested gallery you wish to use, so it defaults to the last one in the main gallery. Instead I suggest using a ForAll function to indicate you want to use them all:

     

    Concatenate("Total $",
    Sum(
     ForAll(
     'Main Gallery'.AllItems, 
     Sum(
     ThisRecord.Data,
     RoleRateCart_1.Value
     )
     ),
     Value
    )
    )

     Whether this works depends on what type of object RoleRateCart_1 is, so in case you encounter any errors, please share the details on that. If it is a control, please share how it gets its' value.

  • Dudditz Profile Picture
    467 on at

    HI BCBuizer,  Thank you so much for your feedback.  I have tried the formula as suggested and it's still throwing blanks.

     

    Here are some additional details.

     

    RoleRateCart_1 field formula - 

    Text(
    Value(Sum((Value(RoleQuantityCart_1.Value * RoleBaseRateCart_1.Value) - Value(RoleQuantityCart_1.Value * RoleBaseRateCart_1.Value) * (Value(RoleDiscountCart_1.Value) / 100)))),
    "[$-en-US],$#,###.00"
    )

     

    This field data is patched into Dataverse currency based field however that is after the fact and I am speculating that is not our issue here.

     

    And just to confirm this was working when designed around a single gallery without the nesting and the field RoleRateCart_1 is performing the math as expected and has values being displayed currently in the nested gallery.  The Sum field is what is still blank.

     

    Thank you for any additional ideas.

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard