Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Combining Search, Filter, and Sort for a Gallery

(1) ShareShare
ReportReport
Posted on by

I have two functions that work on their own.... but can't figure out a way to combine them into one function.

 

Search(Sort('Permit Management','Project Name',SortOrder.Ascending),'Search Input'.Text,'Project Name','Work Order')

 

Filter('Permit Management','Project Status'='cmbProject Status Filter'.Selected.Value)

 

Permit Management = Dataverse table name

Project Status is a Choice Column with a combo box named Project Status Filter

 

Would you need more info than this?

  • marshallzart Profile Picture
    marshallzart on at
    Combining Search, Filter, and Sort for a Gallery
    @Amik
     
    I have come back to this formula because I need to only include Approval Status (column name) that equals Approved. There's only 3 choices for that column (Pending, Approved, Rejected). Any idea how I'd add that?
  • Ami K Profile Picture
    Ami K 15,650 on at
    Re: Combining Search, Filter, and Sort for a Gallery

    @marshallzart - note that the code offered by @happyume is useful in case you're using SharePoint (the Search function is not delegable with that data source).

  • marshallzart Profile Picture
    marshallzart on at
    Re: Combining Search, Filter, and Sort for a Gallery

    Thank you, I tried this but it ended up changing a lot of the Project Names from what they are named in the columns. The functions worked (ie sort, search and filter) though.

     

    The solution Amik posted above did exactly what I was looking for though. 

    Thank you

  • marshallzart Profile Picture
    marshallzart on at
    Re: Combining Search, Filter, and Sort for a Gallery

    This worked perfectly, I'm new to this so I will spend some time trying to understand how/why it works

  • Mitanshu Profile Picture
    Mitanshu 1,604 on at
    Re: Combining Search, Filter, and Sort for a Gallery

    Can you try this formula:

    With(
    	{
    	baseTable:
    		Filter(
    		'Permit Management',
    		'Project Status'='cmbProject Status Filter'.Selected.Value
    		)
    	},
    	Sort(
    		Search(
    			baseTable,
    			'Search Input'.Text,
    			'Project Name','Work Order'
    		),
    		'Project Name',
    		SortOrder.Ascending
    	)
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If this post or my previous reply was useful in other ways, please consider giving it Thumbs Up.

  • Verified answer
    Ami K Profile Picture
    Ami K 15,650 on at
    Re: Combining Search, Filter, and Sort for a Gallery

    @marshallzart - 

     

    Sort(
     Search(
     Filter(
     'Permit Management',
     Len('cmbProject Status Filter'.Selected.Value) = 0 || 'Project Status' = 'cmbProject Status Filter'.Selected.Value
     ),
     'Search Input'.Text,
     'Project Name',
     'Work Order'
     ),
     'Project Name',
     SortOrder.Ascending
    )

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,445

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,741

Leaderboard