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

Need help. Can't count file item when get file from sharepoint.

Please help to fix this flow.  I can't count file item when get file from sharepoint.

This is my flow and error.

 

count-1.png

 

 

 

count-2.png

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User II
Super User II

Hi @Sarun ,

To count the number of files(items) resulted from "Get Files (properties only) 2" action use:

length(body('Get_files_(properties_only)_2')?['value']) 

as value for 'initialize variable 2' action. 

Please note that this formula will count the folders also. To remove the folders from counting you need an additional action, something similar to:

Capture.PNG

See that the last action refer to the results of the 'Filter array' action.

Also, like @jinivthakkar , i'm not quite sure why do you need this intel saved into a variable.

 

Hope it helps !

View solution in original post

4 REPLIES 4
Memorable Member
Memorable Member

@Sarun your array is set to null and on the next step you are trying to get the length of null array ?? Are you sure your logic is correct?

 

I think that's the error.

Super User II
Super User II

Hi @Sarun ,

To count the number of files(items) resulted from "Get Files (properties only) 2" action use:

length(body('Get_files_(properties_only)_2')?['value']) 

as value for 'initialize variable 2' action. 

Please note that this formula will count the folders also. To remove the folders from counting you need an additional action, something similar to:

Capture.PNG

See that the last action refer to the results of the 'Filter array' action.

Also, like @jinivthakkar , i'm not quite sure why do you need this intel saved into a variable.

 

Hope it helps !

View solution in original post

@gabibalaban Now I can count the number of files, Thank you very much for your help.

@jinivthakkar Thank you for your suggest.

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Microsoft Ignite

Microsoft Power Platform: 2021 Release Wave 1 Plan

Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (12,301)