cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
demondan Helper I
Helper I

Count items in array

Hi

I have exported a sharepoint list into an array variable (and stripped away the data im not interested in) resulting in the following items:

 

{"Title": "Dan"},{"Title": "John"},{"Title": "Rich"}
 
How do I count the number of items? So in this example will be 3? I've tried length('arrayNam') and this returns an incorrect value?
 
thanks
Dan
1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: Count items in array

Hi @demondan,

I have tried on my side that use length(variable('arrayNam')), and it return value 3.

Please make sure your Array format and the expression are correct.

Annotation 2019-08-21 134923.png

Annotation 2019-08-21 134907.png

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

6 REPLIES 6
Super User
Super User

Re: Count items in array

Hi @demondan ,

 

Try length(variables('arrayNam')?['value'])

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Community Support
Community Support

Re: Count items in array

Hi @demondan,

I have tried on my side that use length(variable('arrayNam')), and it return value 3.

Please make sure your Array format and the expression are correct.

Annotation 2019-08-21 134923.png

Annotation 2019-08-21 134907.png

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

Highlighted
demondan Helper I
Helper I

Re: Count items in array

Hi

What does compose do?

 

Thanks

Dan

Community Support
Community Support

Re: Count items in array

Hi @demondan,

 

I input length(variable('arrayNam')).

Annotation 2019-08-21 171349.png

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.

demondan Helper I
Helper I

Re: Count items in array

Hi

So the array I have I exactly extracted it from a sharepoint list.  I am thinking the format is possibly not correct, is there a way to just display the format of the array when i run the flow?  Like a print to screen or a log/console?

 

thanks

dan

Super User
Super User

Re: Count items in array

@demondan 

Hey there.  So, you may have already seen this...but if you go to the main page for your Flow, you can see all of the past runs.  If you click on any one of those, you can then click on each step and see the input and output for each.

 

Not sure if that gets you where you want to go, but hopefully it sets you on the right track.

 

-Ed-

 

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: 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!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (8,270)