cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Data_Enthusiast
Post Patron
Post Patron

Camera image duplicates for each Gallery item

Hello Power Apps Community,

Scenario: I am creating a page where you can take a picture of various items - within a Gallery.

Issue: I can capture an image, however when I take images of more Gallery items, the images are replicated for all items - as seen below.

I would appreciate any help 🙂

ImageExample.JPG

Thank you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Data_Enthusiast
Post Patron
Post Patron

For anyone who comes across this, I managed to solve this by doing the following:

Create a Collection for your images being taken:

Collect(CameraPhoto, {Photo: Camera.Stream, FileName: Title.Text});

On the Gallery (Items), use AddColumns to add the Collection:

AddColumns('SP List', "FilePhoto", LookUp(CameraPhoto, FileName = Name, Photo))

 Then add the following to your Image control:

ThisItem.FilePhoto

View solution in original post

7 REPLIES 7
eka24
Super User III
Super User III

The image usually takes one of the columns in your table.

If the images are not in a table but saved locally in your app, then try the local table below:

Set( MyImagesTable,
Table(
{ ImageColumn:MyPic1},
{ ImageColumn:MyPic2},
{ ImageColumn:MyPic3}
))
 
So on your Gallery items put MyImagesTable, then the Image within the Gallery ImageColumn
------------

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

The Items property of my Gallery is referencing a SharePoint list which provides the product names. I get an error message when I add the additional formula - that you kindly provided, to the Items property of the Gallery. 

Error: Behavior function in a non-behavior property.

Please clarify for me.

You dont have a column for Image for the Sharepoint List and you want to add it now?

If  so then for each image you take, update the Sharepoint list image column.

 

Or Create a Collection that combines the image and the existing sharepoint list

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

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 

Correct, I do not have a column in my list to store the image, but I would like to add it.

The Gallery is referencing a list that holds the Master list of products, and the list that I would like to Patch to is a different SP list (for transaction type data) - which is where the image column is. 

SP List 1: Master Products List

SP List 2: Patching transaction based data to

Gallery: Referencing SP List 1 in terms of products. But the additional info being captured such as the image must go to SP List 2 - along with the associated product name. 

So for each image you take, update the sharepoint column.

https://youtu.be/2QeOILfo1Bw?t=3

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

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 followed the steps identified in the video but unfortunately it did not resolve the issue.

When I stored the photo's taken in a Collection, I get the following:

ImageExample.JPG

When I Patch the collection to SharePoint, the column where the image is meant to populate remains blank.

I have tested this outside a Gallery and got it right - by assigning each Image item a variable, but this is not a sustainable solution. 

Data_Enthusiast
Post Patron
Post Patron

For anyone who comes across this, I managed to solve this by doing the following:

Create a Collection for your images being taken:

Collect(CameraPhoto, {Photo: Camera.Stream, FileName: Title.Text});

On the Gallery (Items), use AddColumns to add the Collection:

AddColumns('SP List', "FilePhoto", LookUp(CameraPhoto, FileName = Name, Photo))

 Then add the following to your Image control:

ThisItem.FilePhoto

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (20,941)