cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

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
Highlighted
Community Support
Community Support

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
Highlighted
Community Support
Community Support

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

Highlighted
Regular Visitor

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

Thanks @v-micsh-msft !

Helpful resources

Announcements
firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Users online (6,683)