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 / Filter not working in ...
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:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,315 Most Valuable Professional on at

    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

  • Raizo Profile Picture
    66 on at

    THanks

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

    screenshot code error.png

  • Verified answer
    WarrenBelz Profile Picture
    155,315 Most Valuable Professional on at

    @Raizo ,

    A bracket after If( may assist here

  • Raizo Profile Picture
    66 on at

    Thanks Warren! Yup! That did it .

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 899

#2
Valantis Profile Picture

Valantis 571

#3
11manish Profile Picture

11manish 499

Last 30 days Overall leaderboard