cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pasquale_p
Helper I
Helper I

Load a part of documents from Manually trigger

 

Cattura.PNG

 

Hi all,

I need a advice from you,

I've got a partner that load day by day some documents, for example

 

day 1, he load 3 documents

day 2, he load 5 documents

day 3, he load 1 document

 

I need that these documents will be stored in a SharePoint folder

how can I solve this?

I put, for example, 5 fields where he can upload documents, but if he one day upload 2 documents the flow broke

 

how I can load a not definite number of documents?

 

thanks for your support

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-litu-msft
Community Support
Community Support

Hi @pasquale_p,

 

You could convert the triggerBody into string, then use "contentBytes" as separator convert it into an array by using split() function, then use length() function to get the length of array. After all, length of array sub 1, the length will be number of uploaded.

Annotation 2020-06-18 151850.jpg

 

 

sub(length(split(string(triggerBody()),'contentBytes')),1)

 

(Screenshot is not correct, I resubmit it, sorry)

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-litu-msft
Community Support
Community Support

Hi @pasquale_p,

 

You could convert the triggerBody into string, then use "contentBytes" as separator convert it into an array by using split() function, then use length() function to get the length of array. After all, length of array sub 1, the length will be number of uploaded.

Annotation 2020-06-18 151850.jpg

 

 

sub(length(split(string(triggerBody()),'contentBytes')),1)

 

(Screenshot is not correct, I resubmit it, sorry)

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hi @v-litu-msft, thanks for your support,

 

I'm new on Power Automate, so, after creating the manual trigger for upload documents, I add new steps "compose" for each upload field, or one time?

 

thanks a lot for your support

Pasquale

Hi @pasquale_p,

 

The compose action just a process of carrying expressions, and it's a good data acceptance container.

At the step, you just need to create it once.

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-litu-msft, my last last question,😃

 

if my partner upload 3 files of 6 possibilities

the process will be now:

 

MANUAL TRIGGER -->COMPOSE 1 --> COMPOSE 2 --> CREATE FOLDER --> CREATE FILE1 --> CREATE FILE2 -->CREATE FILE3 --> CREATE FILE4 --> CREATE FILE5 --> CREATE FILE6

 

thank you for your support

 

Hi @pasquale_p,

 

If you have 6 create file actions but only three files received, the Flow will run first three create file actions, then it will report error and stop.

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA 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

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (90,443)