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

Attaching Images

Hi!

I have made an app for equipment inspection. The first screen shows a gallery that preview each submission, and a form that has all the information they filled out once you click it from the gallery. But I am trying to add the option to upload images before each inspection is submitted. Instead of having the camera in the first screen I would like to have it at the very end, and once it's submitted have the images avaiable in the form of the first screen. Is that possible? I've been trying to see how to do it, but i'm not able to figure it out. Attached is a picture of my first screen. 

12 REPLIES 12
Super User
Super User

Re: Attaching Images

Are you uploading images or taking them with the camera?  If you take them with the camera you can easily store them in a collection and have the first screen load them from the collection when you navigate back.  Uploaded images act differently and are a bit more difficult to manipulate other than where you upload them.



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

Re: Attaching Images

I'm hoping to upload them. It'll be a bit difficult for the user to be taking a picture everytime. Instead they want the option to take the pictures and when doing the inspection, upload them to the corresponding equipment. I'm also storing all this information in a sharepoint list. 

Super User
Super User

Re: Attaching Images

The problem with uploaded images is that the binary of the image isn't actually in PowerApps, its kept in the browser's cache.  As I result I've never seen a way to get the actual contents of the image to store it in a collection. You can display it based off the URL of the upload location, but that normally doesn't happen until you save the record.



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

Re: Attaching Images

Thanks for your response. So theres no way to have an option to attach images at the end of every inspection, and once it's submitted be able to view them in the form? 

Super User
Super User

Re: Attaching Images

I'm sure there are ways to accomplish that.  But its much more difficult than manipulating Camera photos.  I can't give you a quick easy way to do it or point you at a blog that details the steps.



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

Re: Attaching Images

I understand. Would you mind showing me the way you first recommended? Having the option of taking the picture with the camera and having them stored in the first screen.

 

Thanks!

Super User
Super User

Re: Attaching Images

1) Add the Camera control to the third screen.

2) Set the Camera control's OnSelect to Collect(mypics,{Title:TextInput1.Text,Pic:Camera1.Photo}) . Each time a picture is taken it will be added to the mypics collection.

3) Set the Items property of the Gallery on Screen1 to mypics.  And the Image control in the gallery to ThisItem.Pic. Since the collection is visible to the whole app the pictures will appear in the Gallery as soon as they are added to the collection and you navigate back to the screen.

 



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

Re: Attaching Images

How do I set the items property of the gallery to mypics? It currently has InspectionList there. And for the image control I would add the one that is under Media, correct? 

Super User
Super User

Re: Attaching Images

I assume the Inspections List gallery contains the records being inspected and you want the pictures to be attached to one record in that gallery.  If that's the case I would expect you'll need to add another gallery to hold the pictures. I don't think you can nest a gallery within a gallery.

 

I don't think the problem is going to be getting the pictures to show.  The problem is that I think you have multiple items in the Inspection list and you want to attach different pictures to each item in the list. Its a many to many relationship that is going to be very difficult to implement.

 

You could add an additional field to the picture collection when you take the pictures that holds an identifier for the record you want to relate them to.  Then in the second gallery filter the items property of the pictures based on the identifier of the selected record in Inspection list.

 



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

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 80 members 4,450 guests
Please welcome our newest community members: