Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

filter gallery search bar and user

(0) ShareShare
ReportReport
Posted on by 395

I have a gallery with the datasouce linked to sharepoint list and currently have the gallery filtered (see below, i have this under Items) I am trying to add search bar that a user can type into to filter by customer.  So i have added a text input (SrchBox), then trying to add;
Search(KBXoffline, SrchBox.Text,"Customer") in the items off the gallery. Because i already have the syntax below, it wont allow me to to ; and paste it in. Do i need to combine these two syntax?

FirstN(Sort(If(User().Email in varAdminEmail, KBXoffline, Filter(KBXoffline, 'Created By'.Email = User().Email)), Created, Descending), 50)

 

Any assistance would be much appreciated,

KR's,

Matt383

 

 

Categories:
  • Matt383 Profile Picture
    Matt383 395 on at
    Re: Filter gallery search bar and user

    Thanks Warren, that did the trick 😉

  • WarrenBelz Profile Picture
    WarrenBelz 145,580 on at
    Re: Filter gallery search bar and user

    Hi @Matt383 ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    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 the content was useful in other ways, please consider giving it Thumbs Up.

  • Verified answer
    WarrenBelz Profile Picture
    WarrenBelz 145,580 on at
    Re: Filter gallery search bar and user

    Hi @Matt383 ,

    Typing gremlins again - should be colon : in the With() statement - corrected in original post

  • Matt383 Profile Picture
    Matt383 395 on at
    Re: Filter gallery search bar and user

    Hi Warren, still no luck. Do I replace the wKBX with the field i am searching for? 

    The function sort, with, filter has invalid arguments

  • WarrenBelz Profile Picture
    WarrenBelz 145,580 on at
    Re: Filter gallery search bar and user

    OK @Matt383 ,

    This should find up to 500 without Delegation Warnings (and you  can increase this to 2,000 in Advanced Settings)

     

    With(
     {wKBX:KBXOffline},
     FirstN(
     Sort( 
     Filter(
     wKBX, 
     If(
     User().Email in varAdminEmail,
     true,
     'Created By'.Email = User().Email
     ) &&
     SrchBox.Text in Customer
     ), 
     Created, 
     Descending
     ), 
     50
     )
    )

     

    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 the content was useful in other ways, please consider giving it Thumbs Up.

  • Matt383 Profile Picture
    Matt383 395 on at
    Re: Filter gallery search bar and user

    Currently around 40-50 and increasing

  • WarrenBelz Profile Picture
    WarrenBelz 145,580 on at
    Re: Filter gallery search bar and user

    Hi @Matt383 ,

    I meant the number of records in your list (not fields)

  • Matt383 Profile Picture
    Matt383 395 on at
    Re: Filter gallery search bar and user

    Hi Warren, i have aprox 20 fields i am capturing in the sharepoint list but only need to filter 1-2 fields in the gallery

  • WarrenBelz Profile Picture
    WarrenBelz 145,580 on at
    Re: Filter gallery search bar and user

    Hi  @Matt383 ,

    Please see updated post - dangers of free-typing. NOTE; the in Filter (and Search) are not Delegable, neither is User().Email (although there is a workaround for this). How many records are in your list ?

     

    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 the content was useful in other ways, please consider giving it Thumbs Up.

  • Matt383 Profile Picture
    Matt383 395 on at
    Re: Filter gallery search bar and user

    Hi Warren, thanks for feedback. Although no luck

    Delegation warning. The Sort part

    The function sort has some invalid arguments

    Cannot sort on the expression type

    Invalid number of arguments

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,580

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,909

Leaderboard