i have a sharepoint list as datasource
i have set the attachment column in the datasource to only allow one uploaded file.
I want to display this uploaded file in a gallery that have the datasource in ITEMS property.
how to do this? i cant figure out how to load that file in an image controle?
i have tried use the powerapps control "add image".... but then i cant figure out how to save that picture to the datasource.
Solved! Go to Solution.
Hi @Oskarkuus ,
Could you tell me whether you have problem about displaying attachments in your gallery or updating your attachments?
1)how to display attachments in your gallery
If one item only has one attachment, you could set like this:
gallery's Items:
listname
image control's Image:
First(ThisItem.Attachments).AbsoluteUri
Just like this:
If one item has multiple attachments , you could set like this:
gallery1's Items:
listname
gallery2's Items:
Gallery1.Selected.Attachments
Image control's Image (inside gallery2):
ThisItem.AbsoluteUri
Just like this:
2)How to update attachments?
I'm afraid it's not supported to update attachments by using add picture button.
You could only use attachments control to update attachments. What's more, attachments only work inside a form and should be updated by using SubmitForm() function.
You should set like this:
gallery's Items:
listname
insert a form to upload attachments
set the form's data source to the same list
set the form's Item:
Gallery1.Selected
Only choose attachments in this form
set the attachments control's OnAddFile:
SubmitForm(Form2)
set the attachments control's OnRemoveFile:
SubmitForm(Form2)
Then after you select item in the gallery, you could upload file in that form.
Just like this:
Best regards,
If you only have one attachment in the attachments that you want to display, then you can put an Image control in your Gallery and set the Image property to First(ThisItem.Attachments).Value
That should display it.
I hope this is helpful for you.
Hi @Oskarkuus ,
Could you tell me whether you have problem about displaying attachments in your gallery or updating your attachments?
1)how to display attachments in your gallery
If one item only has one attachment, you could set like this:
gallery's Items:
listname
image control's Image:
First(ThisItem.Attachments).AbsoluteUri
Just like this:
If one item has multiple attachments , you could set like this:
gallery1's Items:
listname
gallery2's Items:
Gallery1.Selected.Attachments
Image control's Image (inside gallery2):
ThisItem.AbsoluteUri
Just like this:
2)How to update attachments?
I'm afraid it's not supported to update attachments by using add picture button.
You could only use attachments control to update attachments. What's more, attachments only work inside a form and should be updated by using SubmitForm() function.
You should set like this:
gallery's Items:
listname
insert a form to upload attachments
set the form's data source to the same list
set the form's Item:
Gallery1.Selected
Only choose attachments in this form
set the attachments control's OnAddFile:
SubmitForm(Form2)
set the attachments control's OnRemoveFile:
SubmitForm(Form2)
Then after you select item in the gallery, you could upload file in that form.
Just like this:
Best regards,
As long as you're not planning to use this on mobile devices it would work. Otherwise, use the Value as in the formula I provided.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
205 | |
70 | |
51 | |
49 | |
20 |
User | Count |
---|---|
262 | |
120 | |
85 | |
80 | |
68 |