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 / Calculate value ignori...
Power Apps
Unanswered

Calculate value ignoring row selection in gallery

(0) ShareShare
ReportReport
Posted on by 12

Calculate value ignoring row selection in gallery

Hello everyone, I have a checklist gallery where what I want is that the answer combination generates a note for me I did the logic below, but when clicking on a specific line in the gallery and clicking on the "generate note" button, the formula only takes that line into account, but what I want is to consider all the fillings
 

Code:
Set(
Resultado;
Switch(
true;
CountIf(
Gallery1.AllItems;
ComboBox1.Selected.Value = "NÃO" && Text(Subtitle1) = "1"
) > 0;
0;
CountIf(
Gallery1.AllItems;
ComboBox1.Selected.Value = "NÃO" && Text(Subtitle1) = "2"
) > 0;
1;
CountIf(
Gallery1.AllItems;
ComboBox1.Selected.Value = "NÃO" && Text(Subtitle1) = "3"
) > 0;
2;
CountIf(
Gallery1.AllItems;
ComboBox1.Selected.Value = "NÃO" && Text(Subtitle1) = "4"
) > 0;
3;
true;
4
)
)

Categories:
  • Sundeep_Malik Profile Picture
    6,501 on at

    Hey @Davidn7 

     

    To calculate the result based on all the items in the gallery, you need to modify your formula. Instead of using Gallery1.AllItems, which refers to the currently selected item, you should use Gallery1.Items to refer to all the items in the gallery.

     

    Try the following code:

     

    Set(
    Resultado;
    Switch(
    true;
    CountIf(
    Gallery1.Items;
    ComboBox1.Selected.Value = "NÃO" && Text(Subtitle1) = "1"
    ) > 0;
    0;
    CountIf(
    Gallery1.Items;
    ComboBox1.Selected.Value = "NÃO" && Text(Subtitle1) = "2"
    ) > 0;
    1;
    CountIf(
    Gallery1.Items;
    ComboBox1.Selected.Value = "NÃO" && Text(Subtitle1) = "3"
    ) > 0;
    2;
    CountIf(
    Gallery1.Items;
    ComboBox1.Selected.Value = "NÃO" && Text(Subtitle1) = "4"
    ) > 0;
    3;
    true;
    4
    )
    )

     

     

     

    I hope this helps 🙂

  • Davidn7 Profile Picture
    12 on at

    Unfortunately it didn't work

    Error: Gallery1.Items are not recognized

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 339 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 289

#3
Mohsin Ali Profile Picture

Mohsin Ali 228

Last 30 days Overall leaderboard