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 / How to I program an ic...
Power Apps
Unanswered

How to I program an icon in my power app to trigger a click of my camera control?

(0) ShareShare
ReportReport
Posted on by 42

In my app I have a camera control and a camera icon. I want the user to be able to click on a camera icon so that it triggers the same effect as clicking on the camera control. The OnSelect code for the camera control "Camera1" is the following:

 

Set(
 varName,
 GUID()
);
Collect(
	colImages,
	{
		DisplayName: varName & ".jpg",
		Id: varName & ".jpg",
		Value: Camera1.Photo
	}
);

 

Meanwhile, the OnSelect code for the camera icon is the following:

 

Select(Camera1)

 

The OnSelect code for Camera1 works perfectly, but for some reason, whenever the user click's on the camera icon, it takes a blank photo and fails to add it to the attachment list.  My app is modeled after this Reza Dorrani youtube video. Does anyone know why that my Select(Camera1) code for the camera icon is not working? How can I get this camera icon to behave exactly the way Camera1 does?

 

BeckTableImageUpload.JPG

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at

    Hi @powaya ,

    Please have a look at the first part of this blog of mine as I use a camera button on it to initiate an action. I capture the camera Stream, so please see if this suits your model.

     

    Please click Accept as solution 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 Thumbs Up.

  • WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at

    Hi @powaya ,
    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    Please click Accept as solution 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 Thumbs Up.

  • powaya Profile Picture
    42 on at

    Hi @WarrenBelz ! Thanks for your response. I'm new to this so I had a hard time understanding what the code in your  “Camera” icon OnSelect is doing. I'm curious why clicking on my camera icon can't simply trigger the OnSelect code of my Camera1 using the code below (note: Camera1 is the beige block at the top of my screenshot, above my camera icon)

     

    Select(Camera1)

     

  • WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at

    Hi @powaya ,

    My blog was simply an example of one way of achieving the result. You can certainly click on the camera control, but your post had an icon, so I assumed that is how you wanted to trigger it.

     

    Please click Accept as solution 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 Thumbs Up.

  • powaya Profile Picture
    42 on at

    @WarrenBelz I want clicking on both of these to do the same thing. The code for clicking on the image preview (I pasted it below) works perfectly. Now I want clicking the camera icon to mimic that same action. What's the best way to do that?

     

    BeckTableImageUpload2.jpg

     

    Set(
     varName,
     GUID()
    );
    Collect(
    	colImages,
    	{
    		DisplayName: varName & ".jpg",
    		Id: varName & ".jpg",
    		Value: Camera1.Photo
    	}
    );

     

  • WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at

    @powaya ,

    Add to the OnSelect of the Camera control.

     

    Please click Accept as solution 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 Thumbs Up.

  • powaya Profile Picture
    42 on at

    @WarrenBelz That's where that code currently resides, on the OnSelect of the camera control. But when I add that same code to the OnSelect of the camera icon, then clicking on the camera icon simply adds an additional copy of the most recent photo that was taken, as opposed to taking a new photo. Do you know why that is?

  • GvR Profile Picture
    2 on at

    Check this explanation in this Youtube video which explains exactly this.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard