web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Filter an excel table ...
Power Automate
Unanswered

Filter an excel table and paste the result to a different table

(0) ShareShare
ReportReport
Posted on by 33

Hi,

I managed to extract the data in terms rows & columns in Power Automate Desktop. My flow looks like as follow:

spsn_0-1645166036894.png

but from here, I cannot use all the cell range, only partial of it, for example below is the range of cells of data from the input file:

I only want to extract the ones highlighted in yellow and paste the items to a different table.

spsn_1-1645166300619.png

How to execute this? I don't see any flow that I can directly use to identify a table in the desktop.

 

Tia.

I have the same question (0)
  • Henrik_M Profile Picture
    2,021 Super User 2024 Season 1 on at

    Ahhh, manipulation of datatable; one of the concepts where Power Automate Desktop falls short.

     

    Here is what I would try:

    For each loop down through the datatable.

    Each loop item becomes a datarow.

    Work your conditional logic on each of these rows, and if it is "yellow", add it the current item to a new list.

    After the loop is over, write your list of yellows into your new sheet.

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    I don’t know what you are filtering on, let’s assum it is Invoice No.


    Create List %NeededRows%

    Launch Excel

    Get First Free Row

    Read from Excel A1 to H and %FirstFreeRow - 1% to %ExcelData%, title row = true 

    Read from Excel A1 to H1 as %CurrentInvoice% ‘Note: Title row only, we will add the rows we want through loop logic.

    For Each %CurrentItem% in %ExcelData%
        If %CurrentItem[‘Invoice No’] = G004

             Set variable %CurrentInvoice% to %CurrentInvoice + [CurrentItem]% to %CurrentInvoice%
            ‘Note:  this should add the datarow to the datatable %CurrentInvoice%.  You might have to play around with the syntax here. Check the Advanced Datatype section of this page if it’s not working:  https://docs.microsoft.com/en-us/power-automate/desktop-flows/variable-data-types#advanced-data-types

     

        End (If)

    End (For each)


    good luck

            

             

  • UK_Mike Profile Picture
    on at

    Not sure what the filter is nor if its being appended or not, but Power Query within Excel and write the result to new sheet ?

  • VJR Profile Picture
    7,635 on at

    Hi @spsn 

     

    What is your criteria to filter those yellow rows?

  • spsn Profile Picture
    33 on at

    The criteria is Billing period

  • VJR Profile Picture
    7,635 on at

    Hi Tia,

     

    You can use Excel as a database and then query on it.

     

     

    VJR_3-1645337047398.png

    ExcelFile is a variable containing the full path of Excel

     

    VJR_4-1645337105725.png

     

     

     

    VJR_2-1645336057164.png

     

     

     

    After executing the above SQL statement I get the desired rows in a datatable called as QueryResult.

     

    VJR_1-1645335757153.png

     

     

    Then write this datatable to the new place where you want to write using "Write to Excel Worksheet" action.

    I know the date formats are changed but this is just to get you started and you can try working on the date formats.

     

     

  • spsn Profile Picture
    33 on at

    Hi VJR,

     

    I never use SQL connection before. Do I do it after I get the Excel data or I do this SQL portion before?

     

    THanks.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 267 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 196

#3
Haque Profile Picture

Haque 182

Last 30 days Overall leaderboard