cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
javierMiranda
Level: Powered On

number of files after 'SFTP>List Files in Folder'

HI,

First, sorry for my english, I'm french :-)

 

My flow succesfully use an SFTP connexion and get the list of files in folrder.

After that  I have a  condition depending on the number of files presents in the folder.

But to know the number of files I need to use 'For each' and increment a varibale. This action is very long.

Is ther a way to knwo immediately after the 'List Files in forder' action the number of files without having to incerement a variable ?

 

Thanks in advance.

Javier

 

Edit: in the screenshot we can see that counting 164 items takes 2m:

image.png

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: number of files after 'SFTP>List Files in Folder'

Hi @javierMiranda,

 

Yes, there is a way to count the file number.

We need a Compose Action, and the length() function.

"

Returns the number of elements in an array or string. For example, this function returns 3:

length('abc')

Parameter number: 1

Name: Collection

Description: Required. The collection for which to get the length.

"

Function reference: WorkFlow Definition Language.

For Example:

10.PNG

The running result:

11.PNG

 

Regards,

Michael

Community Support Team _ Michael Shao
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

2 REPLIES 2
Community Support Team
Community Support Team

Re: number of files after 'SFTP>List Files in Folder'

Hi @javierMiranda,

 

Yes, there is a way to count the file number.

We need a Compose Action, and the length() function.

"

Returns the number of elements in an array or string. For example, this function returns 3:

length('abc')

Parameter number: 1

Name: Collection

Description: Required. The collection for which to get the length.

"

Function reference: WorkFlow Definition Language.

For Example:

10.PNG

The running result:

11.PNG

 

Regards,

Michael

Community Support Team _ Michael Shao
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

javierMiranda
Level: Powered On

Re: number of files after 'SFTP>List Files in Folder'

Thanks @v-micsh-msft !

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 388 members 4,542 guests
Please welcome our newest community members: