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 / Set Button DisplayMode...
Power Apps
Suggested Answer

Set Button DisplayMode Based on Image Titles in Collection

(2) ShareShare
ReportReport
Posted on by 5,325 Super User 2025 Season 2
I have Button1 ('Save Job').

I have Button2 (AddMediaButton).

I want to control the DisplayMode of Button1 with the following formula.

Button2 (AddMediaButton) 'OnSelect' has the following.

If 'Invoice Type' "Install", and "Other" title NOT in the Collection, and the Gallery count equals 10, AND all the titles (except "Other") appear in the DisplayName
of Install_Job_Image_Collection then set Button1 (Save Job) DisplayMode to Edit else Disabled. 

 
 If(
        AJP_Invoice_Type_Fld.Text = "Install" And Not("Other" in Install_Job_Image_Collection.DisplayName) And AJP_Image_Gallery.AllItemsCount = 10 And CountRows(
            Filter(
                Install_Job_Image_Collection,
                DisplayName in [
                    "Attic Entry (If wall fish)",
                    "Exterior Entry",
                    "Install Agreement",
                    "Light at Modem",
                    "Modem Online",
                    "Modem Stickers",
                    "Speed Test at Furthest",
                    "Speed Test at Midpoint",
                    "Speed Test at Modem",
                    "Wall Plate",
                    "Other"
                ]
            )
        ) =10,
        DisplayMode.Edit,
 
 
Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,452 Super User 2025 Season 2 on at
     
    I am unsure what part you are saying isn't working, I see some code, and I see some pasted code, but what is exactly wrong.
     
    Either way you cannot set the DisplayMode of Button one, with the code you have in Button 2, not exactly
     
    Either
     
    1. You have to set some variable in button 2 that changes button 1s display mode
    2. Add the code to button 1 instead of 2
    3. In Button 1, set its DisplayMode whatever Button 2s DisplayMode is
     
    But the code you have above, looks like what you put in button 2 as your description is confusing.
     
    Please clarify if that code is in button 1 or 2 and if its in 2, what are you doing in 1 that would make it work?
     
    Like you said said this is in Button 2

    If 'Invoice Type' "Install", and "Other" title NOT in the Collection, and the Gallery count equals 10, AND all the titles (except "Other") appear in the DisplayName
    of Install_Job_Image_Collection then set Button1 (Save Job) DisplayMode to Edit else Disabled. 
     
    But that code won't work as the syntax is wrong.
     
    You said
    I want to control the DisplayMode of Button1 with the following formula.
    but then immediately talked about button2 and showed no code for button 1

    Button2 (AddMediaButton) 'OnSelect' has the following.

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard