cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ProNewbie
Level: Powered On

How to determine if an Image Control is empty

Hi, this is my setup at the moment :

There is a Camera Control which when it's clicked sends a picture into a variable,

then an Image Control shows the image contained inside this variable

and there is a button that sends the image into a SharePoint Document Library with a Flow.

 

I would like to set the button.DisplayMode property to something like this :

If(IsEmpty(imageCapturedImage); Disabled; Edit)

But it doesn't work, my goal is to disable the button if no pictures have been selected yet.

 

Thanks in advance for any suggestion, ProNewbie

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: How to determine if an Image Control is empty

Use IsBlank rather than IsEmpty, which is for tables or collections.

If(IsBlank(Image1.Image),DisplayMode.Disabled, DisplayMode.Edit)


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

3 REPLIES 3
Dual Super User
Dual Super User

Re: How to determine if an Image Control is empty

Use IsBlank rather than IsEmpty, which is for tables or collections.

If(IsBlank(Image1.Image),DisplayMode.Disabled, DisplayMode.Edit)


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Community Support Team
Community Support Team

Re: How to determine if an Image Control is empty

Hi @ProNewbie ,

How do you save the Captured picture into a variable within your app? Could you please share a bit more about the formula?

 

Actually, it is not necessary to detect if the Image control is empty. As an alternative solution, you could consider detect if the variable which stores your captured image is blank.

I have made a test on my side, please take a try with the following workaround:

Set the OnSelect property of the Camera control to following:

Set(CapturedPic, Camera1.Photo)

Set the Image property of the Image control to following:

CapturedPic

Set the DisplayMode property of the Button control to following:

If(
   IsBlank(CapturedPic),
   DisplayMode.Disabled,
   DisplayMode.Edit
)

Set the OnSelect property of the Button control to following:

'YourFlowName'.Run(...);   /* <-- Fire a flow, pass the captured picture to your flow */
Set(CapturedPic, Blank())   /* <-- Reset the CapturedPic variable after your fire your flow */

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ProNewbie
Level: Powered On

Re: How to determine if an Image Control is emptyt

Thanks to both for the answers, it worked using IsBlank() instead of IsEmpty().

 

ProNewbie

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (6,015)