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

Re: Take only the first x number of items in array

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

Re: Take only the first x number of items in array

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

Highlighted
New Member

Re: Take only the first x number of items in array

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!

Highlighted
Dual Super User III
Dual Super User III

Re: Take only the first x number of items in array

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
Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Top Solution Authors
Top Kudoed Authors
Users online (7,049)