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

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors
Users online (2,522)