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 / compare 2 label before...
Power Apps
Answered

compare 2 label before submit

(0) ShareShare
ReportReport
Posted on by 418

Hi, I have 2 label in Gallery.. I need to compare If the value in this 2 label is same(number), the button will Enable/Edit.. but If not same the button should be disable.. I have use this formula but nothing happen..

 

Button displaymode property:

If(Label169.Text = Label172.Text, DisplayMode.Edit, DisplayMode.Disabled)

 

twister_0-1618579654213.png

 

 

Thanks

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @twister 

    You mention you have two labels in a Gallery...is the button in the gallery or outside of the gallery?

  • rubin_boer Profile Picture
    4,843 Super User 2024 Season 1 on at

    hi @twister how many rows do you have where the labels are represented? 

     

    if you have more than one row the first is evaluated by the button for e.g. (1=1 so you can edit)

    rubin_boer_0-1618580332954.png

     

    now 1 != 10 you cant edit irrespective the last value where 10 = 10

    rubin_boer_1-1618580394041.png

     

    hope this helps

  • twister Profile Picture
    418 on at

    @RandyHayes sorry not to informed..the button outside the Gallery...

  • twister Profile Picture
    418 on at

    @rubin_boer the rows is dynamic...can be 1,2 or more..

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @twister 

    Very good....so, if ALL of the labels must match in the Gallery, then you can use the following formula:

    If(
     Sum(yourGallery.AllItems, Value(Label169.Text)) = 
     Sum(yourGallery.AllItems, Value(Label172.Text)), 
     DisplayMode.Edit, 
     DisplayMode.Disabled
    )
  • twister Profile Picture
    418 on at

    @RandyHayes thanks sir...works as expected..

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
wolenberg_ Profile Picture

wolenberg_ 119 Super User 2026 Season 1

#2
WarrenBelz Profile Picture

WarrenBelz 107 Most Valuable Professional

#3
Haque Profile Picture

Haque 103

Last 30 days Overall leaderboard