Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Filter not working in gallery when using index and split function

(0) ShareShare
ReportReport
Posted on by 66

This is odd and I don't know enough about why my filter would cause an error when I am pulling out just the name from the people picker value in Sharepoint. This is in reference to the question answer here. 

Solved: Re: How to separate out just first and last name t... - Power Platform Community (microsoft.com)

But as you can see from the screenshots below I am using a string function to capture just the first and last name from a people picker field in SharePoint. That part works great. But when I try to apply a filter on my gallery I get an "index" error. Also see attachment below. Thoughts?

screenshot filter.pngscreenshot no filter.png

Categories:
  • Raizo Profile Picture
    66 on at
    Re: Filter not working in gallery when using index and split function

    Thanks Warren! Yup! That did it .

  • Verified answer
    WarrenBelz Profile Picture
    147,870 Most Valuable Professional on at
    Re: Filter not working in gallery when using index and split function

    @Raizo ,

    A bracket after If( may assist here

  • Raizo Profile Picture
    66 on at
    Re: Filter not working in gallery when using index and split function

    THanks

    Thanks for the quick response Warren. But now I am getting the error below....

    screenshot code error.png

  • WarrenBelz Profile Picture
    147,870 Most Valuable Professional on at
    Re: Filter not working in gallery when using index and split function

    Hi @Raizo ,

    Just adding to the previous code I supplied - test to see if there is something in the field

    If(
     Len(ThisItem.Facilitator.DisplayName) > 0,
     With(
     {
     _Data:
     Split(
     ThisItem.Facilitator.DisplayName,
     ","
     )
     },
     Index(
     Split(
     Index(
     _Data,
     2
     ).Value,
     " "
     ).Value,
     2
     ).Value & " " & 
     First(_Data).Value
     )
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >