cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lazy
Frequent Visitor

Datatable Slicing

I have a datatable that has two columns.

 

How do I slice the second only to write to an Excel worksheet?

 

I tried

%DataTable[:][1]%

but this returned the second row!

 

I thought that the datatable was addressable like Python dataframes

1 ACCEPTED SOLUTION

Accepted Solutions
fraenK
Memorable Member
Memorable Member

PAD only knows data table and data row, not columns, so you can loop through the rows of a column by %DatatableVariableName[i]['ColumnName']% or just get a column as a list:

https://docs.microsoft.com/en-us/power-automate/desktop-flows/actions-reference/variables#retrieveda...

https://docs.microsoft.com/en-us/power-automate/desktop-flows/variable-data-types#advanced-data-type...

 

View solution in original post

3 REPLIES 3
fraenK
Memorable Member
Memorable Member

PAD only knows data table and data row, not columns, so you can loop through the rows of a column by %DatatableVariableName[i]['ColumnName']% or just get a column as a list:

https://docs.microsoft.com/en-us/power-automate/desktop-flows/actions-reference/variables#retrieveda...

https://docs.microsoft.com/en-us/power-automate/desktop-flows/variable-data-types#advanced-data-type...

 

lazy
Frequent Visitor

Awesome!

Set variable to %DataTable[1]% worked

Retrieve data table column into list action also works!

lazy
Frequent Visitor

Good to know that slicing by rows works though, e.g., %DataTable[3:]% returns all rows from the fourth!💡

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (2,984)