cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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
Anonymous
Not applicable

No it's okay I can add another gallery. I won't be having an image for every item. I'll be adding the camera in the very last screen and if the user wants to add 2-3 pictures i wanted to give them the option to do so. But wanted to make sure they show up in the first screen with the corresponding equipment. 

Hi @Anonymous ,

Could you please share a bit more about the data source you used within your app? Is it a SP List?

Do you add a Edit form within your New Inspection screen to collect the user's input?

Further, do you want to capture the pictures using Camera control?

 

Currently, within PowerApps, there is no way to upload pictures captured via Camera control to a data source directly.

 

If the data source you used within your app is a SP List (use SP List to store the Inspection), I think it is not necessary to add a Camera control to capture the picture files, the Attachments control could achieve your needs.

On your side, within the Edit form in your New Inspection screen, you could enable the "Attachments" field (data card), then you could use the Attachments control to capture files from your local device. When you submit the form, the picture files attached within the Attachments control (in your Edit form) would be saved along with the Inspection record into your SP list as attachments.

More details about the Attachments control in PowerApps, please check the following article:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/controls/control-attachments

 

If the data source you used within your app is not a SP list, I afraid that there is no direct way to achieve your needs. As an alternative solution, you could consider save the pictures captured via Camera control into your SP Library along with a unique file name using the combination of PowerApps and Microsoft Flow. In addition, you need to create a new SP list to store the Inspection record ID and unique file name of the uploaded pic files.

More deetails about uploading files captured via Camera control from PowerApps to SP Library, please check the following blog:

https://www.techmikael.com/2017/05/an-even-more-clever-workaround-for.html

Then within your first screen, you could look up the pic files from your SP Library based on the Inspection Record ID. You could add another Gallery (Gallery2), and set it to Photo Layout. Set the Items property of the Gallery (Gallery2) to following:

Filter(
         'YourSPLibrary',
          'File name with extension' in Filter('YourNewList', InspectionID = Gallery1.Selected.ID).UniqueFileName
)

Note: The InspectionID represents the column in your New SP list, which used to store the ID value of the Inspection record. The UniqueFileName represents the column in your New SP list, which used to store the unique file name of the uploaded picture files. The Gallery1 represents the Gallery control in your first screen, which used to show all Inspection Submissions.

Within the Gallery2, set the Image property of the Image control to following:

ThisItem.'Link to item'

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.
Anonymous
Not applicable

Thanks for your response!

My data source is a SP List. I was hoping their was a way to either attach photos or capture photos at the end of each inspection. I'd like to add that option on screen 5, and once they click the submit button all the content for that piece of equipment will be avaible to view in the Intro screen (where I have my gallery and edit form). I have attached how screen 5 looks. 

Helpful resources

Announcements
Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

<
Users online (2,561)