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

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

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!



Community Support Team
Community Support Team

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
Level: Powered On

Re: Count items in array

Hi

What does compose do?

 

Thanks

Dan

Community Support Team
Community Support Team

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
Level: Powered On

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
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

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 Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 102 members 5,138 guests
Please welcome our newest community members: