cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
stapes
Impactful Individual
Impactful Individual

How do I reset an Add Picture control.?

How do I reset the Add Picture control. First time it opens, it displays the Sample Image. I would like it to revert to this each time the screen is loaded.

1 ACCEPTED SOLUTION

Accepted Solutions
eka24
Super User
Super User

I suggest you try this:

In the Onvisible of the screen create a variable:

UpdateContext({ShowSample:true} )

 

Then in the image;

If(ShowSample,SampleImage,Cemera1.Photo)

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

5 REPLIES 5
eka24
Super User
Super User

I suggest you try this:

In the Onvisible of the screen create a variable:

UpdateContext({ShowSample:true} )

 

Then in the image;

If(ShowSample,SampleImage,Cemera1.Photo)

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

eka24
Super User
Super User

@stapes 

Am checking if the issue is resolved?

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Hi @eka24 ,

When do you update the ShowSample variable to false?

Thanks,

Fernando

It depends on your situation. In the case above anytime he navigate to another screen the variable is set to false automatically since it UpdateContext. 

 

However if on the same screen you want to Set it to false, you can insert a Button and Onselect;

UpdateContext({ShowSample:false} )

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Hi @eka24 ,
I was having problems using Reset(AddMediaButton) but now I can use it and it works fine.

Thanks,

Fernando

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (968)