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 / Gallery Filters using ...
Power Apps
Answered

Gallery Filters using Search and Mid (Nesting Expressions)

(0) ShareShare
ReportReport
Posted on by 60

I have a gallery that successfully displays items from a SharePoint list's second column and successfully filters using a search box. My gallery's Items says: 

Search('iPassport Facilities & OUs List',Input_SearchOUs.Text,"field_1")

I now only want it to display items that have a / or space as the 4th character. I'm trying first to tackle the / and have come up with: 

If(
Mid(
Search('iPassport Facilities & OUs List', Input_SearchOUs.Text,"field_1" ), 4, 1 ) , "/", Result)

 

I'm not sure if the issue is in Items or in my gallery's Text property, which is currently blank. What is the difference between a gallery's Text property and Items property? 

 

Thank you in advance! I still have so much to learn...

Categories:
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    HI @stellarwheels ,

     

    Gallery do not have a Text property.

    vbofengmsft_0-1677550529664.png

     

     

    Could you please describe your needs in detail? Could you provide some samples and screenshots?

     

    Best Regards,

    Bof

     

  • stellarwheels Profile Picture
    60 on at

    Okay, thank you for the clarification. I can definitely provide more detail. These are the titles of my elements:

    • SharePoint List: iPassport Facilities & OUs List
    • Column Name: field_1
    • Search Box: Input_SearchOUs
    • Gallery: Gallery_SG

     

    My Gallery's Items states the following, which works to query the : 

    Search('iPassport Facilities & OUs List',Input_SearchOUs.Text,"field_1")     

     

    This works to pull the proper list in the gallery and filter using the search entry.

    stellarwheels_0-1677589519924.png

     

    Now I want to add another layer to the expression so that the items that populate the gallery are only those with a space or a / as the fourth character. I do not want to remove the unwanted items from my SharePoint list, because it serves as a data source for other Galleries.

     

    I thought using Mid( or If( might help me with this goal, but I'm not getting anything to work.

  • stellarwheels Profile Picture
    60 on at

    OR if it is easier, instead of only populating the gallery with the SharePoint List items that have a space or / as the fourth character, I could also have it pull only the items that have the first three characters capitalized. Is there a way to program that instead?

  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @stellarwheels ,

     

    Please try:

     

    Filter(
     Search('iPassport Facilities & OUs List',Input_SearchOUs.Text,"field_1"),
     Mid(field_1,4,1) in ["/"," "]
    )

     

     

    Best Regards,

    Bof

  • stellarwheels Profile Picture
    60 on at

    Thank you very much! That is not at all how I thought they would nest within each other. I appreciate your time, Bof.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 350 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 318

#3
Mohsin Ali Profile Picture

Mohsin Ali 220

Last 30 days Overall leaderboard