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
v-litu-msft
Community Support
Community Support

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
abm
Super User III
Super User III

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 blogPower Automate Video Tutorials
v-litu-msft
Community Support
Community Support

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

Hi

What does compose do?

 

Thanks

Dan

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.

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

@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
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,463)