cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
amyharkus86
Resolver II
Resolver II

Patch attachments

Hello,

 

I have application that has couple of edit forms, 

 

EditForm1, EditForm2 and EditForm3

 

After completing 1 the user hits next and goes to the next page and so on at the end they can submit 

Patch('SP_ListName',Defaults('SP_ListName'),EditForm1.Updates, EditForm2.Updates, EditForm3.Updates)

 All good, but I want to add the attachment control to each of these forms, When I hit submit it only keeps the last (EditFrom3) attachment. 

 

I'd like all 3 forms to be able to patch the attachments to the same attachment field in the SharePoint list

 

Each forms attachment data cards is 

 

Attachments_DataCard1 , DataCardValue1

Attachments_DataCard2,  DataCardValue2

Attachments_DataCard3 , DataCardValue3 

 

And if this is possible.....

 

Is there a way of having all the attachment added in each field shown in one attachment field at the end? 

for example having Attachments_DataCard4 that shows all the attached files/photo...etc that have been attached in 1,2 and 3?  

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @amyharkus86 ,

 

Your needs can be achieved. If you have 3 forms, the attachments added in the first two forms will appear in the third form and submitted.

 

I did a test for you:

1\ I have 2 form ‘Form1’ and ‘Form2’ in screen1. I have 1 form ‘Form3’ in screen2.

v-xiaochen-msft_0-1616042098075.png

 

 

2\ Set OnAddFile property of the first form’s Attachment’s DataCardValue ‘DataCardValue3’ to:

 

ClearCollect(Test1,DataCardValue3.Attachments)

 

 

Set OnRemoveFile property of the first form’s Attachment’s DataCardValue ‘DataCardValue3’ to:

 

ClearCollect(Test1,DataCardValue3.Attachments)

 

 

3\ Set OnAddFile property of the second form’s Attachment’s DataCardValue ‘DataCardValue4’ to:

 

ClearCollect(Test2,DataCardValue4.Attachments)

 

 

Set OnRemoveFile property of the second form’s Attachment’s DataCardValue ‘DataCardValue4’ to:

 

ClearCollect(Test2,DataCardValue4.Attachments)

 

 

4\ Add a screen ‘Screen2’.

 

5\ Add an icon and set its onselect property to:

 

ClearCollect(Test3,Test1,Test2);ClearCollect(Test4,AddColumns(RenameColumns(Test3,"Name","DisplayName"),"Id",""));Navigate(Screen2)

 

 

6\ Set Items property of the third form’s Attachment’s DataCardValue ‘DataCardValue5’ to:

 

Test4

// This form is in screen2

 

 

7\ Set other properties of ‘DataCardValue5’ like picture:

v-xiaochen-msft_1-1616042098078.png

 

 

8\ Add a submit Icon in Screen2 and set its onselect property to:

 

Patch(LIST99,Defaults(LIST99),Form1.Updates,Form2.Updates,Form3.Updates)

// LIST99 is my test list.

 

 

9\ The result is as follows:

 

v-xiaochen-msft_2-1616042209951.png

v-xiaochen-msft_3-1616042284782.png

v-xiaochen-msft_4-1616042335695.png

 

 

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

2 REPLIES 2
v-xiaochen-msft
Community Support
Community Support

Hi @amyharkus86 ,

 

Your needs can be achieved. If you have 3 forms, the attachments added in the first two forms will appear in the third form and submitted.

 

I did a test for you:

1\ I have 2 form ‘Form1’ and ‘Form2’ in screen1. I have 1 form ‘Form3’ in screen2.

v-xiaochen-msft_0-1616042098075.png

 

 

2\ Set OnAddFile property of the first form’s Attachment’s DataCardValue ‘DataCardValue3’ to:

 

ClearCollect(Test1,DataCardValue3.Attachments)

 

 

Set OnRemoveFile property of the first form’s Attachment’s DataCardValue ‘DataCardValue3’ to:

 

ClearCollect(Test1,DataCardValue3.Attachments)

 

 

3\ Set OnAddFile property of the second form’s Attachment’s DataCardValue ‘DataCardValue4’ to:

 

ClearCollect(Test2,DataCardValue4.Attachments)

 

 

Set OnRemoveFile property of the second form’s Attachment’s DataCardValue ‘DataCardValue4’ to:

 

ClearCollect(Test2,DataCardValue4.Attachments)

 

 

4\ Add a screen ‘Screen2’.

 

5\ Add an icon and set its onselect property to:

 

ClearCollect(Test3,Test1,Test2);ClearCollect(Test4,AddColumns(RenameColumns(Test3,"Name","DisplayName"),"Id",""));Navigate(Screen2)

 

 

6\ Set Items property of the third form’s Attachment’s DataCardValue ‘DataCardValue5’ to:

 

Test4

// This form is in screen2

 

 

7\ Set other properties of ‘DataCardValue5’ like picture:

v-xiaochen-msft_1-1616042098078.png

 

 

8\ Add a submit Icon in Screen2 and set its onselect property to:

 

Patch(LIST99,Defaults(LIST99),Form1.Updates,Form2.Updates,Form3.Updates)

// LIST99 is my test list.

 

 

9\ The result is as follows:

 

v-xiaochen-msft_2-1616042209951.png

v-xiaochen-msft_3-1616042284782.png

v-xiaochen-msft_4-1616042335695.png

 

 

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

amyharkus86
Resolver II
Resolver II

@v-xiaochen-msft thank you, that was just what i need, works perfectly.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,688)