web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter not working in ...
Power Apps
Unanswered

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
    153,042 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
    153,042 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard