cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NigelP
Level 8

Sending a list of attachments to a form to a sharepoint list

Hi

 

I have a form which has an attachments control on the form.

 

I can attach files to the form.

 

I can send one file to a flow which works great by adding the attachments to a collection and sending the first item in the collection to the flow.

 

How do I send all of the attachments to a flow ?

 

There is no iterate function like for all items in a collection do this.

 

Would forall work ? if so how ?

 

Thanks

 

Nigel

7 REPLIES 7
pcaracc
Level 8

Re: Sending a list of attachments to a form to a sharepoint list

If I'm understanding your question, perhaps something like 

 

ForAll('Attachment_Collection', Flow.Run(attachment))

Where 'Attachment_Collection' is the collection with your attachments, "Flow.Run()" is your flow's method, and "attachment" is what you've named the attachments stored in your collection

NigelP
Level 8

Re: Sending a list of attachments to a form to a sharepoint list

Thanks ! Great !

 

This requires both '{Attachment}'.DisplayName and '{Attachment}'.AbsoluteUrl to be in  in the collection 'Attachment_Collection'.  How do I get them into this one collection.  At the moment I have them in two collection Attachments and AttachmentsUrl.

 

Thanks

 

Nigel

 

pcaracc
Level 8

Re: Sending a list of attachments to a form to a sharepoint list

Well when a new attachment is added to the attachments control, you can collect both of the name and Url with something like

 

Collect('Attachment_Collection',{name:DisplayName, url:AbsoluteUrl})

I'm not familiar with attachment control though, so I am not 100% positive.

 

Can you post what parameters are required for your flow to run and can you also post how you have been adding attachments to a collection

NigelP
Level 8

Re: Sending a list of attachments to a form to a sharepoint list

Hi 

 

I only need two parameters :-

 

DisplayName and AbsoluteUri

 

I will add more parameters later eg foldername and project name.

 

I add attachments to a collection so :- 

 

ClearCollect(Attachments,SubmissionsGallery1.Selected.'{Attachments}'.DisplayName);

ClearCollect(AttachmentsUri,SubmissionsGallery1.Selected.'{Attachments}'.AbsoluteUri);

UploadafiletoSharePointfromPowerApps.Run(First(Attachments).DisplayName,First(AttachmentsUri).AbsoluteUri) <-- My Flow

 

Regards

 

Nigel

NigelP
Level 8

Re: Sending a list of attachments to a form to a sharepoint list

Hi 

 

I only need two parameters :-

 

DisplayName and AbsoluteUri

 

I will add more parameters later eg foldername and project name.

 

I add attachments to a collection so :- 

 

ClearCollect(Attachments,SubmissionsGallery1.Selected.'{Attachments}'.DisplayName);

ClearCollect(AttachmentsUri,SubmissionsGallery1.Selected.'{Attachments}'.AbsoluteUri);

UploadafiletoSharePointfromPowerApps.Run(First(Attachments).DisplayName,First(AttachmentsUri).AbsoluteUri) 

 

Regards

 

Nigel

pcaracc
Level 8

Re: Sending a list of attachments to a form to a sharepoint list

ClearCollect will remove everything from the collection before adding the new item. If you are trying to collect multiple items in the collection, you should just use Collect instead. Afterwards, you can call the flow using ForAll on the collection containing the attachments

 

Collect(AttachmentsCollection, {attachmentname: SubmissionsGallery1.Selected.'{Attachments}'.DisplayName, attachmenturi: SubmissionsGallery1.Selected.'{Attachments}'.AbsoluteUri})


ForAll(AttachmentsCollection, UploadafiletoSharePointfromPowerApps.Run(attachmentname, attachmenturi))
NigelP
Level 8

Re: Sending a list of attachments to a form to a sharepoint list

Hi

 

I will try that.

 

Regards

 

NIgel

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

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