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 Apps / Sort/Filter not workin...
Power Apps
Answered

Sort/Filter not working as expected

(0) ShareShare
ReportReport
Posted on by 116

Hi,

 

I'm pretty new to PowerApps and I'm trying to do a basic Sort and Filter on a gallery.  I looked through previous posts and based on what I've read, this should be correct, but I must be missing something.

 

The filter  ws working before I wrapped it in a sort (I tried both Sort and SortByColumns with same error).  I'm just trying to sort my results based on a date field in my list.

 

SortByColumns(Filter('Email Tracking', Status.Value <> "Complete")),'Send Date',Ascending)

 

I'm getting an "invalid number of arguments: received 1, expected 2 or more" error.  

 

filterSort.jpg

 

I'm not sure what else to try.

 

Thanks for any help!

Angie

Categories:
I have the same question (0)
  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @aharsh 

    You have an incorrect syntax as a result of your formula.

    SortByColumns(Filter('Email Tracking', Status.Value <> "Complete")),'Send Date',Ascending)

    There is an extra ")" after Complete.  An easy way to double check your formulas against this mistake is to count the number of "(" s and it should be the same as the number of  ")"' s.  

  • aharsh Profile Picture
    116 on at

    Hi @Drrickryp , Thanks for your help!

     

    I had actually tried all sorts of params, brackets, quotes, and commas before posting and nothing worked.  The one you suggest (which is clearly correct - thank you) just gives me a different error, saying I have invalid arguments.

     

    SortByColumns(Filter('Email Tracking', Status.Value <> "Complete"),'Send Date',Ascending)

     

    This is my code.  Email tracking is my list, complete is what I'm filtering by and send date is what I'm trying to sort by.   

     

    Still stumped.

  • aharsh Profile Picture
    116 on at

    BAH - figured it out.

     

    In this case "sort" worked, not "sortbycolumn".

     

    Thank you!

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard