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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,751)