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

Add picture to existing an existing SharePoint list-item

Hello my fellow PowerAppers!

 

I have made a service desk-app where the data is stored in Azure SQL and the pictures in a sharepoint list. The app creates a record for each case where the pictures are stored. I have two questions:

 

#1

What is the best way to display the images for the case in the app? The way I figured out how to do it is probably not the best way... It goes as follows:

 

Gallery1.Items:
First(Filter(SharePointList,ID=CaseID)))

The reslut is a gallery with all the records for the list that each can hold multiple pictures. This gallery is not visable as it only serves Gallery2.

 

Gallery2.Items:
Gallery1.Selected.'{Attachments}'

The image control in the gallery is set to ThisItem.AbsoluteUri. The reslut is a gallery which displays all the pictures from the record that matches the CaseID. It works fine for me but I bet there is a better way to do it.

 

 

#2

Lets say the user creates a case and upload three images. I review the case and find out I want more pictures. How do I collect more pictures to the same record from powerapps? Is this even possible?

 

 

I have tried to search the forums and youtube for a solution to my issues but I can't find one. I would appreciate any help I can get and please tell me if you need more information aboiut my app.

 

Cheers,

Joakim 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Add picture to existing an existing SharePoint list-item

Hi @JoakimAndersson ,

Could you please share a bit more about your scenario?

Further, could you please show more details about the data structure of your SP list?

 

For your first question, I agree with your thought almost. If you just want to display attachments images for a specific case in your SP list, I think it is not necessary to add two Gallery controls within your app, a single one Gallery could achieve your needs:

Set the Items property of the Gallery1 (Image layout) to following:

LookUp(SharePointList, ID = CaseID).Attachments

Set the Image property of the Image control within the Gallery to following:

ThisItem.AbsoluteUri

For your second question, do you want to add extra attachment images to an existing SP list item? Based on the needs that you mentioned, I think you could consider take a try to add a Edit form to achieve your needs (using Edit form control to edit an existing SP list item).

I have made a test on my side, please take a try with the following workaround:4.JPG

 

5.JPG

On your side, within your app, you could add a Gallery (Gallery1) to display the list of Case records in your SP list. Set the Items property of the Gallery to following:

'YourSPList'

Add a Edit icon button within above Gallery, set the OnSelect property to following:

EditForm(Form1);
Navigate(Screen2, ScreenTransition.Fade)

Within the Edit screen, add a Edit form (Form1), set the Data Source property to your SP list data source. Set the Item proeprty of the Edit form to following:

Gallery1.Selected

Set the OnSuccess property of the Edit form to following:

Back()

Set the OnSelect property of the "Submit" button to following:

SubmitForm('YourSPList')

Please check the following GIF screenshot for more details:Test.gif

 

 

In addition, for your first question, you could also consider take a try to add a nested Gallery control within your first Gallery (Gallery1) as below:6.JPG

Set the Items property of the nested Gallery (Gallery2) to following:

ThisItem.Attachments

Set the Image property of the Image control within the nested Gallery (Gallery2) to following:

ThisItem.AbsoluteUri

 

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.

View solution in original post

3 REPLIES 3
Community Support Team
Community Support Team

Re: Add picture to existing an existing SharePoint list-item

Hi @JoakimAndersson ,

Could you please share a bit more about your scenario?

Further, could you please show more details about the data structure of your SP list?

 

For your first question, I agree with your thought almost. If you just want to display attachments images for a specific case in your SP list, I think it is not necessary to add two Gallery controls within your app, a single one Gallery could achieve your needs:

Set the Items property of the Gallery1 (Image layout) to following:

LookUp(SharePointList, ID = CaseID).Attachments

Set the Image property of the Image control within the Gallery to following:

ThisItem.AbsoluteUri

For your second question, do you want to add extra attachment images to an existing SP list item? Based on the needs that you mentioned, I think you could consider take a try to add a Edit form to achieve your needs (using Edit form control to edit an existing SP list item).

I have made a test on my side, please take a try with the following workaround:4.JPG

 

5.JPG

On your side, within your app, you could add a Gallery (Gallery1) to display the list of Case records in your SP list. Set the Items property of the Gallery to following:

'YourSPList'

Add a Edit icon button within above Gallery, set the OnSelect property to following:

EditForm(Form1);
Navigate(Screen2, ScreenTransition.Fade)

Within the Edit screen, add a Edit form (Form1), set the Data Source property to your SP list data source. Set the Item proeprty of the Edit form to following:

Gallery1.Selected

Set the OnSuccess property of the Edit form to following:

Back()

Set the OnSelect property of the "Submit" button to following:

SubmitForm('YourSPList')

Please check the following GIF screenshot for more details:Test.gif

 

 

In addition, for your first question, you could also consider take a try to add a nested Gallery control within your first Gallery (Gallery1) as below:6.JPG

Set the Items property of the nested Gallery (Gallery2) to following:

ThisItem.Attachments

Set the Image property of the Image control within the nested Gallery (Gallery2) to following:

ThisItem.AbsoluteUri

 

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.

View solution in original post

JoakimAndersson
Level: Powered On

Re: Add picture to existing an existing SharePoint list-item

@v-xida-msft Thank you for taking the time to help me out. Your answer solved all of my issues.

 

Have a great day!

 

Cheers,

Joakim

Dawidvh
Level 10

Re: Add picture to existing an existing SharePoint list-item

Hello everyone. In case you still have questions on the topic, we go through this in some more detail in this video.

Display SharePoint List Attachments in PowerApps (2019)

 

The .AbsoluteUri requires the user to be logged into the SharePoint front-end (which is not always the case obviously), while .Value uses the SharePoint connector to fetch the attachment(s) so this is a better option.

 

Dawid van Heerden

Follow on Twitter: @davestechtips

Subscribe to YouTube: https://www.youtube.com/davestechtips?sub_confirmation=1

**If you found this reply helpful, please mark this as the answer to close the topic and make it easier to find for other people with similar questions. AND we get points for it 😉

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,104)