Dear Expertise,
I want to save attachments from the gallery (To save attachments from the UI of PowerApps to particular item on SharePoint List). What should be my approach and the code? As you can see below, I have taken the attachment control from the form and pasted on the gallery, not sure how to save data through it. Is it possible to do it? Or is there any generic way to do it? Please suggest.
Here is the code on OnSelect properties for my Submit button.
Can someone provide me guidance/help on this? Please share screenshots as i'm a beginner on PowerApps.
Thank you in advance,
Athirah
Solved! Go to Solution.
Hi @Athirah :
Do you want to add attachments through Gallery?
If so,this is impossible in theory, but I have a alternative solution.
The main point of this solution is to submit attachments through an invisible form. I've made a test for your reference:
1\My data source:
2\Add an edit form control(Form1)
DataSource
BookLog
Item
Gallery4.Selected /*I'll create Gallery4 later*/
3\Add a gallery control
Items
BookLog
4\Unlock Form1's Attachment data card and copy the Attachment control(DataCardValue3) into Gallery4(DataCardValue3_1)
5\Set DataCardValue3_1
Items
ThisItem.Attachments
OnAddFile
ClearCollect(TheActh,Self.Attachments);SubmitForm(Form1); /*TheActh is my custom variable*/
6\Set DataCardValue3 (which in form1) 's Items property to
TheActh
7\Set Form1‘s Visible property to
false
Best Regards,
Bof
Hi @Athirah <
The only two ways of saving attachments are SubmitForm() from a form or via Power Automate. You cannot save them from a re-purposed attachment control in a gallery.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi @Athirah ,
Just checking if you got the result you were looking for on this thread. Happy to help further if not.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi @Athirah :
Do you want to add attachments through Gallery?
If so,this is impossible in theory, but I have a alternative solution.
The main point of this solution is to submit attachments through an invisible form. I've made a test for your reference:
1\My data source:
2\Add an edit form control(Form1)
DataSource
BookLog
Item
Gallery4.Selected /*I'll create Gallery4 later*/
3\Add a gallery control
Items
BookLog
4\Unlock Form1's Attachment data card and copy the Attachment control(DataCardValue3) into Gallery4(DataCardValue3_1)
5\Set DataCardValue3_1
Items
ThisItem.Attachments
OnAddFile
ClearCollect(TheActh,Self.Attachments);SubmitForm(Form1); /*TheActh is my custom variable*/
6\Set DataCardValue3 (which in form1) 's Items property to
TheActh
7\Set Form1‘s Visible property to
false
Best Regards,
Bof
Just wondering is there a way to get onremovefile to work? I’m struggling with that.
The only way I can think of is deleting all attachments first, via power automate, then using submit form.
User | Count |
---|---|
252 | |
101 | |
94 | |
47 | |
37 |