cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CommanderKeen
New Member

Take only the first x number of items in array

I have an array containing 200.000 items (lines from a CSV file). I want to select only the first 100.000 items in the array or split the array into multiple arrays. In LogicApps there is a "take"-function but this doesn´t seem to work in PowerAutomate. I have looked into the "filter array"-syntax but I can´t figure out how to filter on the item count/index (e.g. "give me items 10-100") - there is nothing in the content that I can split/filter on.

 

If this is just not possible.. Could I somehow split the string (before it gets converted to an array) on a specific line number?

 

Hope someone has a creative suggestion! Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
efialttes
Super User
Super User

Hi!

"In LogicApps there is a "take"-function but this doesn´t seem to work in PowerAutomate."

 

You mean you already tried to apply a take() based expression in in your flow, and it throws an error due to some sort of reaching a limit below 200.000, right?

And also assume there is not any index column in your csv file, right?

 

Thanx!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

3 REPLIES 3
efialttes
Super User
Super User

Hi!

"In LogicApps there is a "take"-function but this doesn´t seem to work in PowerAutomate."

 

You mean you already tried to apply a take() based expression in in your flow, and it throws an error due to some sort of reaching a limit below 200.000, right?

And also assume there is not any index column in your csv file, right?

 

Thanx!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

Hi I just tried again using take-function (to document the error) but to my surprise it actually worked(!!). Something else must have been wrong when I tried earlier and I was too quick to conclude that the expression was not supported.

 

What I did: I created a Compose-action and used expression: "take(outputs('NAME_OF_MY_ARRAY'),3)" and the output consisted of just the first 3 items as I wanted.

 

Thank you for answering though!

Hi!

Well, I must confess I am also surprised it could deal 200,000 elements.

Thanx for taking the time to mark this topic as solved! THis way other community membersfacing this same challenge in the future will find faster the solution.

You guys make this community great!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Top Solution Authors
Users online (2,365)