cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Super User III
Super User III

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

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
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

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!

Top Solution Authors
Users online (8,496)