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

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Answered

Disable Button if Add image control is empty

(0) ShareShare
ReportReport
Posted on by 7
I am using the AddImage control to upload an Image from My Local harddisk. I want to Disable the Button when an Image is not uploaded.
 
If(IsBlank(UploadedImage1.Image), DisplayMode.Disabled, DisplayMode.Edit)
 
This checks if the UploadedImage1 is empty. This is not working because there is a SampleImage in the Image Property of the Control. 
 
If(IsBlank(AddMediaButton1.Media), SampleImage, AddMediaButton1.Media)
 
 
If I remove SampleImage If(IsBlank(AddMediaButton1.Media), AddMediaButton1.Media)  the Button goes to the disable status. But when I now upload an Image the Uploadedimage1 is and stay's empty and the upload button stay's grayed out.
 
What formula do I have to setup that the Button is grayed-out until a real image is uploaded and when a new image is uploaded the button becomes active and when I click the Button the Image goes to "blank"
 
I have ask different AI bots for a solution, and none of them worked :-)
 
 
 
 
I have the same question (0)
  • Verified answer
    developerAJ Profile Picture
    3,006 on at
    Disable Button if Add image control is empty
     you can use two properties 
    AddMediaButton1.FileName or AddMediaButton1.Media
     
    use below code on DisplayMode property of button
     
    If(
    Len(AddMediaButton1.
    FileName) > 0,
    DisplayMode.Edit,
    DisplayMode.Disabled
    )
     

    If this solution helped you resolve your issue, kindly mark it as accepted — it makes it easier for others to find and also closes the discussion. If you found it useful, a Like ❤️ would be greatly appreciated!

    🤝 Let’s connect on LinkedIn || 📘 Explore more on my articles

  • Verified answer
    WarrenBelz Profile Picture
    150,338 Most Valuable Professional on at
    Disable Button if Add image control is empty
     A quick follow-up to see if you received the answer you needed.

    Please Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    Visit my blog Practical Power Apps    LinkedIn   

     
  • Suggested answer
    TechFreak Profile Picture
    42 on at
    Disable Button if Add image control is empty
    Hi,
    What you can do simply is just check the fileName = "SampleImage", And put your logic of disabled and enabled over it.
  • WarrenBelz Profile Picture
    150,338 Most Valuable Professional on at
    Disable Button if Add image control is empty
    Try this
    If(
       Len(AddMediaButton1.Media) > 0,
       DisplayMode.Edit,
       DisplayMode.Disabled
    )
     
    Please ✅ Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    Visit my blog Practical Power Apps    LinkedIn   

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 982 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 396 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 356

Last 30 days Overall leaderboard