Hello,
I have simple idea behind this.
I want to recreate same function which happens whenever you press "Add attachment", as a button.
Is this possible?
Thank you.
Solved! Go to Solution.
Hi @lukascaplikas :
Do you want to use which camera button to add attachments to the attachments control?
In theory, this is impossible to achieve. Because the function of Add Attachments is integrated internally, we can not call it directly.I think the only way at the moment is to add one more transparent attachment control over the button to achieve similar functions.Like this:
I'v made a test for your reference:
1\Add an edit form
DataSource
List1 /*List1 is my data source*/
Item
First(List1)
2\Copy the attachments control (DataCardValue5) in the from and place its copy(DataCardValue5_1) outside of the from and on the upper layer of the "camera" button
3\Set DataCardValue5_1's
Color
RGBA(0, 0, 0, 0)
BorderColor
RGBA(0,0,0,0)
Fill
RGBA(255, 255, 255, 0)
In a word, it is to turn it into a transparent color
OnAddFile
Collect(Mycollection,Self.Attachments); /*Mycollection is my custom collection*/
Reset(DataCardValue5_1)
Items(Delete its Items)
4\Set DataCardValue5's
Items
Filter(Ungroup(Table({Value:Parent.Default},{Value:Mycollection}),"Value"),!IsBlank(Value))
The purpose of this operation is to combine the original Items in the control and the items collected in the copy into a table.
Best Regards,
Bof
Hey @lukascaplikas
The attachments control is slightly different than other controls but you can also interact with it.
Attachments control have:
Following properties when you will select it.
Basically you can define what will happen when User is adding, removing or canceling removal of the files.
Hope this help if this is resolving your problem please remember to select the answer as solution so other community Users can find answer quicker^^
Regards
Dawid
Hi @lukascaplikas :
Do you want to use which camera button to add attachments to the attachments control?
In theory, this is impossible to achieve. Because the function of Add Attachments is integrated internally, we can not call it directly.I think the only way at the moment is to add one more transparent attachment control over the button to achieve similar functions.Like this:
I'v made a test for your reference:
1\Add an edit form
DataSource
List1 /*List1 is my data source*/
Item
First(List1)
2\Copy the attachments control (DataCardValue5) in the from and place its copy(DataCardValue5_1) outside of the from and on the upper layer of the "camera" button
3\Set DataCardValue5_1's
Color
RGBA(0, 0, 0, 0)
BorderColor
RGBA(0,0,0,0)
Fill
RGBA(255, 255, 255, 0)
In a word, it is to turn it into a transparent color
OnAddFile
Collect(Mycollection,Self.Attachments); /*Mycollection is my custom collection*/
Reset(DataCardValue5_1)
Items(Delete its Items)
4\Set DataCardValue5's
Items
Filter(Ungroup(Table({Value:Parent.Default},{Value:Mycollection}),"Value"),!IsBlank(Value))
The purpose of this operation is to combine the original Items in the control and the items collected in the copy into a table.
Best Regards,
Bof
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 |
---|---|
194 | |
67 | |
48 | |
42 | |
20 |
User | Count |
---|---|
252 | |
121 | |
83 | |
76 | |
69 |