cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sajarac
Level 8

Excel and Pictures

Hello there, I have the following situation and I couldn't figure out how to resolve:

 

I have an excel file saved in my onedrive in a folder and inside that folder I have another folder "Pictures" I would like to use my excel file as a source for my app and that file take the pictures from my folder "Pictures", when I am in the web portal I can see the pictures but not in my phone. any idea what I am doing wrong? or do you have a turorial that I acn follow?

 

Thanks in advance for your cooperation.

 

Regards

 

Sajarac

1 ACCEPTED SOLUTION

Accepted Solutions
PowerApps Staff murali
PowerApps Staff

Re: Excel and Pictures

Hello @sajarac

1. You need to rename the column "Images" to "Images[image]"

2. In the table, ensure the relative path to the image is specified in the contents. For instance, if "Images" is a folder inside "Material List", in order to reference the image correctly you should do it the following way

./Images/image1.PNG

 

Here is a sample

NameImage[image]
FirstImage./Images/HtmlText.PNG
SecondImage./Images/listseparator.PNG

 

Just to simplify things, I have renamed "Material List - Images" to "Images" above.

 

Hope this helps.

 

Thanks

Murali

View solution in original post

14 REPLIES 14
Power Automate Staff audrieg
Power Automate Staff

Re: Excel and Pictures

I plan to post a short video on saving camera images very soon. In the meantime, you might try patching your photo into the file like I've done here:

 

My PowerApp had the following configurations:

 

PREP: Create a folder in OneDrive for Business and permission it for the people that will use your app. Then inside that folder add the Excel file that will be used to collect the image data. The Excel file must have a defined table range (see notes in #1 below). I always put the file inside a folder to make permissions easier, and because PowerApps will create a sub-folder for the images and I want all of that to be grouped together in OneDrive.

 

1. A connection to the Excel File using the OneDrive for Business connection. It's important that your file have a predefined table range because you are really connecting to the table range. I have a template I use for this purpose, private message me and I'll send it to you (columns shown below) . The table range in this case is called "ImageTable" (I used the Define Name dialog in Excel to rename the default Table1 range - but you don't have to.) I only do that because the name of the range becomes the name of the connection in PowerApps, and I like a formal name better than a generic name. Smiley Happy

 

table.PNG

 

2. A Camera control (added from insert>media>camera) is named "MyCamera" and the OnSelect property is:

ClearCollect(ClickedPhoto,{Pic:MyCamera.Photo})

 

3. An Image control (added from insert>media>image) to the right of the Camera control (because I only needed to save 1 photo with each form). I named my image control "ImageSave", and set the "image" property to:

MyCamera.Photo

 

4. You can add a button for save events (added from insert>controls>button). The OnSelect of the button patches the image to the Excel file when the user clicks the button.The Patch formula I used was:

 

If(CountRows(ClickedPhoto)>0,Patch(ImageTable,Defaults(ImageTable),
 {Image:MyCamera.Photo,Tag:txtID.Text}))

 

Note: The "Tag:" in my patch formula is something I added, but you may not need. I used it above to capture the ID number of a list item also being submit on the form I created (it helps me to create relationships in Power BI later on). If you don't need to add meta-data about the photo then just remove "Tag:txtID.Text" above so that it just reads:

 

If(CountRows(ClickedPhoto)>0,Patch(ImageTable,Defaults(ImageTable),
 {Image:MyCamera.Photo}))

 

I added the colors above so that you could see the relationships between the different expressions. You can see the result in the Excel file in the screen shot above, and PowerApps will create a separate folder for the Pictures themselves which the app will be able to access (via an image gallery).

 

Let me know if this helps.

 

Audrie

 

 

 

 

 

 

 

sajarac
Level 8

Re: Excel and Pictures

Thank you very much Audrieg, unfortunatelly, didn't work, sorry , I've followed your instructions but don't know what I am doing wrong. I've got this:

 image1.jpg

 

 

 

What about if I have the pictures files already in onedrive in another folder? there is no way to link in my excel file with those files? I don't know. please help!!

Power Automate Staff audrieg
Power Automate Staff

Re: Excel and Pictures

I have seen that message when I use one of my computers which cannot take pictures. Could you try and switch to the camera of that computer and take a picture (not using PowerApps) just using the computer camera? It could just simply mean your camera isn't available and needs to be set up. (Also, may happen if you did not click "allow" so the camera couild be used when the app was opened.) Have you tried to use the app on your iOS or Android device?

 

Private message me and if you have time today, I could do a screen share with you this afternoon.

 

Thanks for your patience, I'm sure we'll figure it out soon!

 

Audrie

sajarac
Level 8

Re: Excel and Pictures

Thank you very much for your prompt reply, I don't know how to send a PM, but for sure I have time and also I can send you my excel spreadsheet, up to you!

Power Automate Staff audrieg
Power Automate Staff

Re: Excel and Pictures

I think you were tied up when I pinged you this afternoon because I didn't get a reply. I'll be back on Skype tomorrow if you want to try again then. Have a great evening!

sajarac
Level 8

Re: Excel and Pictures

Let me know your best time and I will be connected.

 

Thanks again for your help!!!

sajarac
Level 8

Re: Excel and Pictures

Still having some hard time trying to figure out this.

 

This is my situation

 

I have a folder in one drive "Material List", and also other folder for pictures : "Material List - Images", inside a have around 100 pictures 250 x 250. PNG.

 

I have my excel file in the first folder with the table etc, and one column named "Images". what I am trying to do is insert in my excel file the path for my pictures to show it in my power app with no luck so far.

 

Any idea?

 

Thanks in advance

 

Sajarac

PowerApps Staff murali
PowerApps Staff

Re: Excel and Pictures

Hello @sajarac

1. You need to rename the column "Images" to "Images[image]"

2. In the table, ensure the relative path to the image is specified in the contents. For instance, if "Images" is a folder inside "Material List", in order to reference the image correctly you should do it the following way

./Images/image1.PNG

 

Here is a sample

NameImage[image]
FirstImage./Images/HtmlText.PNG
SecondImage./Images/listseparator.PNG

 

Just to simplify things, I have renamed "Material List - Images" to "Images" above.

 

Hope this helps.

 

Thanks

Murali

View solution in original post

Highlighted
Anonymous
Not applicable

Re: Excel and Pictures

I'm having a problem with this. In the App the camera remains on and I am unable to capture the photo. Any ideas? Thanks.

 

Helpful resources

Announcements
thirdimage

Power Automate 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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,024)