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 Apps / Adding Filter to a table
Power Apps
Suggested Answer

Adding Filter to a table

(0) ShareShare
ReportReport
Posted on by 20
Hey everyone. I'm in the PowerUp challenge part and I'm struggling to add a filter that sort data by the animal type.
I don't know which Operator should I use and which value. Any advice?


I have the same question (0)
  • Suggested answer
    Trait007 Profile Picture
    310 on at

    In a PowerApps Component Framework (PCF), you can filter and sort data by animal type using the correct operator in your DataSet query.

     

    Sorting in PCF

     

    To sort data in a PCF component, use the .sort() function with the correct field name.

     

    Operator to Use in PCF

     

    In PCF, the primary operator for sorting is:

     

    • SortOrder.Ascending (for ascending order)

    • SortOrder.Descending (for descending order)


    •  
     

    Implementation in PCF

     

    If you're using DataSet in PCF, you can define sorting like this:

     
    context.parameters.dataset.sorting.clear();
    context.parameters.dataset.sorting.push({
        name: "animalType", // Replace with the actual field name
        sortDirection: 1 // 1 for Ascending, 2 for Descending
    });
    context.parameters.dataset.refresh();
    
     

    Alternatively, if you're filtering the data manually, you can use JavaScript’s .filter():

     
    let filteredData = dataset.records.filter(record => record.getValue("animalType") === "Dog");
    

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 875

#2
Valantis Profile Picture

Valantis 530

#3
11manish Profile Picture

11manish 432

Last 30 days Overall leaderboard