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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Sum Nested Gallery Tex...
Power Apps
Unanswered

Sum Nested Gallery Textbox

(0) ShareShare
ReportReport
Posted on by 8

I am trying to sum up the total of text boxes inside a nested gallery.

 

Example:

lordtopcat_0-1713835113713.png

 

Country and Type are one vertical gallery, called Forecast and the text boxes are in a horizontal gallery called Forecast_Units. In the black box underneath (which is outside of both galleries) I would like to display the total of that column.

 

I've tried this formula:

Sum(
 Forecast.AllItems, 
 Sum(
 Forecast_Units.AllItems, 
 Value(S050.Text) 
 )
)

 

However, while it doesn't provide me with an error, it doesn't populate.

 

lordtopcat_1-1713835372463.png

 

I've tried various iterations of Sum, Value etc to no avail. I've also made sure the S050 text box is formatted as number.

 

Any assistance please?

Categories:
I have the same question (0)
  • v-mengmli-msft Profile Picture
    on at

    Hi @lordtopcat ,

     

    If the image below is your gallery structure, can I understand that you want to display the total number of the first textbox values in each sub gallery outside of the parent gallery.

    vmengmlimsft_0-1713836743066.png

    Please try this.

    Sum(AddColumns(Forecast.AllItems,"test",Value(First(Forecast_Units.AllItems).S050.Text)),test)

     

    Best regards,

    Rimmon

  • lordtopcat Profile Picture
    8 on at

    @v-mengmli-msft thanks for the suggestion - in the black box I would be expecting 810 to be showing as that is the sum of all text boxes in that column.

     

    I tried your formula, but get the error: Name isn't valid. 'test' isn't recognized.

     

    lordtopcat_0-1713837500933.png

     

    The inner gallery is horizontal, so the text boxes actually expand out to 14 per row:

     

    lordtopcat_2-1713837632389.png

     

    Cheers

  • v-mengmli-msft Profile Picture
    on at

    Hi @lordtopcat ,

     

    Is that a horizontal gallery? Where do you put the formula? It should be on Text of label control.

    vmengmlimsft_1-1713839432502.png

     

    I recommend you add 14 labels manually instead of insert label in gallery, because you're actually vertically calculating the horizontal gallery in the vertical gallery and mapping the results into the horizontal gallery, which can potentially involve adding multiple columns as well as creating collections, I think it's better to use multiple labels to show the total number of each column.

    vmengmlimsft_0-1713839398080.png

     

    For the second label, we can use Index function.

    vmengmlimsft_3-1713839853490.png

     

    At last, please check gallery's name in your formula. I notice that there is a control name isn't recognized.

    vmengmlimsft_4-1713840008606.png

     

     

    Best regards,

    Rimmon

  • lordtopcat Profile Picture
    8 on at

    The black boxes are not in a gallery, as per my original question: "In the black box underneath (which is outside of both galleries)" They are 14 separate labels.

     

    The name of my galleries is correct, so I'm not sure why Forecast_Units isn't registering?

     

    lordtopcat_0-1713840489369.png

     

    Cheers

     

  • lordtopcat Profile Picture
    8 on at

    Oh! I've just realized they are BOTH vertical galleries, would that be why the formula isn't working maybe?

  • v-mengmli-msft Profile Picture
    on at

    Hi @lordtopcat ,

     

    If they are vertical, the method will be simpler.

    Please try this.

    Text of label about S050 text input.

    Sum(ForAll(Forecast.AllItems As C,Sum(C.Forecast_Units.AllItems,S050.Text)),Value)

    Same for other labels, you just need to change TextInput's name.

     

     

    Best regards,

    Rimmon

     

  • lordtopcat Profile Picture
    8 on at

    Hey, I think we're getting closer! Forecast_Units is now recognizing as a control, but still returning blank:

    lordtopcat_0-1713844013969.png

     

  • VishalJhaveri Profile Picture
    1,167 Moderator on at

    I fear if this is possible because there is horizontal gallery inside a vertical gallery. 
    Please try to add more tags so that this wonderful question gets a huge reach while posting the questions.

  • v-mengmli-msft Profile Picture
    on at

    Hi @lordtopcat ,

     

    I tried to reproduce your problem, when I add a label to the parent Gallery and use the following formula, the formula that calculates the total will return the correct result. You can hide the label used for connection in the parent Gallery later.

    Sum(Forecast_Units.AllItems,S050.Text)

    vmengmlimsft_0-1713850953962.png

    I can't figure out what's going on at the moment, it seems like the parent Gallery doesn't recognize the nested Gallery at first.

     

    Best regards,

    Rimmon

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard