cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

Patch attachment field

I have app with 10 fields at the end of the app i run a patch on submit - 

 

Patch('Vehicle Check', {ID: Blank()}, FirstFields.Updates, SecondField.Updates, ThirdField.Updates, FouthField.Updates, FifthField.Updates, SixthField.Updates, SeventhField.Updates, EighthField.Updates, NinthField.Updates, TenthField.Updates);Navigate('Thank You', ScreenTransition.None) 

 

The problem i'm having is that most of the forms i need attachments, i would like to see all the attachments added in each field form once submited at the moment it will only display the last photo attached, All the others get removed. 

 

How do i achive this? 

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Patch attachment field

Hi @amyharkus86 ,

I think the formula that you listed is a little strange.

Firstly, Updates is the form's property. Data card's property is Update.

Secondly, the Patch function's right syntax is:

Patch(tablename,item,{...})            //item shoule be the item that you want to update

Patch(tablename,Defaults(tablename),{....})       

While what you use is: {ID: Blank()}, this can not represent an item.

 

I assume that you want to create a new record, try this formula:

Patch('Vehicle Check',Defaults('Vehicle Check'),Form1.Updates)

What's more, the Attachments field's setting inside the form is also important.

Here's my setting for your reference:

Set the attchments data card's Update: DataCardValue8.Attachments

8194.PNG

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Resolver I
Resolver I

Re: Patch attachment field

I've changed my path to reflect your 

 

Patch('Vehicle Check',Defaults('Vehicle Check'),Form1.Updates) 
Patch('Vehicle Check',Defaults('Vehicle Check'),FirstFields.Updates, SecondField.Updates, ThirdField.Updates, FouthField.Updates, FifthField.Updates, SixthField.Updates, SeventhField.Updates, EighthField.Updates)

This is a lot cleaner and works as required, Thank you. 

 

The problem i have with attachments still remains, 

 

On my first field input screen 'firstfield'

It picks up the first name and last name two fields i have in sharepoint list, I then have added the attachment field, If i take a photo on the app this shows in my sharepoint list as expected and the details all show as i would like. 

 

screenshot1.JPG

I then have a second form page with called 'secondfield' on another page on the app

this has more fields from the same list vehicle make, model, fleet number and these update the sharepoint list as i would like. 

I've again added the same attachment field

When i take a photo or add an attachment from the second field it updates the form and removes the attachment made in the 'firstfield', What i would like is to be able to add an attachment on firstfield and another on the second, Not replacing the first attachment made in the firstfield but as an additional attachment. 

screenshot2.JPG

 

first attachment field on firstfield has Update: DataCardValue70.Attachments 

second attachment field on secondfield has Update: DataCardValue71.Attachments 

 

I've tried putting them both as Update: DataCardValue71.Attachments i get the same results only one attachment shows in my sharepoint list

 

screenshot3.JPG

Is there away of instead of updating the attachment field it combines all the attachments from all the editforms to the same attachment field?

 

I know there is currently no way to have more then one attachment field but if there is away to combine all them that would work for my situation. 

 

I see the question of adding more attachment fields has been asked mutiple times but this is an example of it 

https://powerusers.microsoft.com/t5/General-Discussion/Create-multiple-Attachments-in-single-powerap... 

Although this would be better, A solution work around for me would be to combine all attachments to the one field with in sharepoint, is this possible? 

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,348)