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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / PowerFX Filter not wor...
Power Automate
Unanswered

PowerFX Filter not working with datatables

(0) ShareShare
ReportReport
Posted on by 11

Hello,

 

I am trying to use the Filter command in a datatable using PowerFX. I am getting the data table by using the "Extract data from window" action.

 

In the table there are a lot of blank rows, so I want to filter those off, however, using Filter on that datatable I get "Parameter 'Value': invalid argument type"

I am thinking this is because it has no idea what type that variable is until it gets assigned? How can I correct this?

I have the same question (0)
  • eetuRobo Profile Picture
    4,204 Super User 2025 Season 2 on at

    I think filter as a function would only work for datatable type.
    I assume the issue is that Power Fx is still in preview and there are some issues and limitations to it. 

    But maybe as you assumed that Filter -function doesn't really know what type the variable is and thats why it gives error. Because atleast I got it to work if I created the table inside the filter function. But if I create the datatable in a variable before then it gives that same error you get.

    eetuRobo_1-1711091285612.png


    I think the filter function might see all variables as "general value" types and that is a limitation right now in PAD power fx
    Under the known issues and limitations:

    eetuRobo_2-1711091374909.png

    https://learn.microsoft.com/en-us/power-automate/desktop-flows/power-fx

     

     

    So maybe consider changing to non power fx enabled flow or try to figure out how to loop through and remove the blank rows in power fx enabled flow

  • eetuRobo Profile Picture
    4,204 Super User 2025 Season 2 on at

    It seems like since Power FX enabled flows don't have much capabilities for datatables yet you might want to try using Run .NET script:

    eetuRobo_0-1711093105768.png

    Assuming the data table you have has column named "Column1". Now that also removes any row that has empty value in Column1 so you might have to change that a bit if you want to keep rows that has Column1 empty but maybe has values in other columns.

     

    press Edit button next to Script parameters:

    eetuRobo_1-1711093145246.png

    Input value should be your data table that you are trying to filter. Out variable can be the same or what ever new variable you want.

     

    Or just copy paste this to your PAD flow(and edit script parameters if the variables are different named than DataFromWindow):

     

    Scripting.RunDotNetScript Language: System.DotNetActionLanguageType.CSharp Script: $fx'DT1 = DT1.DefaultView.ToTable();
    DT1.DefaultView.RowFilter = "Column1 <> \'\' OR Column1 IS NOT NULL";
    DT1.DefaultView.RowFilter = "TRIM(ISNULL(Column1, \'\')) <> \'\'";
    DT1 = DT1.DefaultView.ToTable();' @'name:DT1': $fx'=DataFromWindow' @'type:DT1': $fx'Datatable' @'direction:DT1': $fx'InOut' => DataFromWindow

     

     

     

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Pretty sure yours doesn't work because you used the Table expression without the equals sign. If you did =Table(), it should work.

     

    But it's likely not the same when the table is not created from within the Table() expression, but instead retrieved from an external source, like a window. It is probably interpreted as a general value. @Handro , you might want to try converting your table to an actual table by using =Table() and passing in your extracted data variable inside the brackets. This might work as it would convert the variable to a table that can then be filtered.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard