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.

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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (3,563)