Skip to main content
Community site session details

Community site session details

Session Id : kzAh76/rW/TaTi0KE8UVWx
Power Apps - Building Power Apps
Answered

Filter a gallery by textinput

Like (0) ShareShare
ReportReport
Posted on 5 Apr 2023 19:18:35 by

I want to filter a gallery by the text input. The data are from sharepoint and the filter should filter by the names of the people. Every profile of the gallery has a picture from from themselves. 

 

When i use Filter(Berater; Pos.Selected.Position = Position; TextInput1.Text = Name) , it compiles but when i run it i get an error on this code:
'Office365-Benutzer'.UserPhotoV2(ThisItem.Mitarbeiter.Email) 

 

 

 

Categories:
  • Community Power Platform Member Profile Picture
    on 05 Apr 2023 at 20:21:37
    Re: Filter a gallery by textinput

    i fixed now the code by adding to the image in the gallery this code 

    If(!IsBlank(ThisItem.Mitarbeiter); 'Office365-Benutzer'.UserPhotoV2(ThisItem.Mitarbeiter.Email))

     and so this code compiles and runs but if i put a name in the textinput it does not do anything not filtering.

     Filter(Berater; Pos.Selected.Position = Position; TextInput1.Text = Name)

     There is warning about delegation and data sets, could this be a reason ?

  • Community Power Platform Member Profile Picture
    on 05 Apr 2023 at 19:36:32
    Re: Filter a gallery by textinput

    first of all thank you, in my case i have to use semicolon instead commas but i still get issues.

     

     

    Filter(Berater;
    Pos.Selected.Position = Position &&
    If(
    IsMatch(ThisItem.Mitarbeiter.Email; Match.Email);
    Lower(ThisItem.Mitarbeiter.DisplayName) = Lower(TextInput1.Text);
    false
    )

     

    He still shows me error like in ismatch and lower method

     

    in the lower and match method he cannot work with "." and he says lower has invalid arguments

  • Verified answer
    SimnaJ Profile Picture
    205 on 05 Apr 2023 at 19:24:49
    Re: Filter a gallery by textinput

    The error you are encountering may be related to the fact that some of the items in your gallery do not have a valid email address associated with them, or that the email address is not recognized by the 'Office365-Benutzer'.UserPhotoV2() function.

    To work around this issue, you may need to add a condition to your formula that checks if the email address is valid before calling the UserPhotoV2() function. Here is an example of how you can modify your formula to include this condition:

    Filter(Berater,
    Pos.Selected.Position = Position &&
    If(
    IsMatch(ThisItem.Mitarbeiter.Email, Match.Email),
    Lower(ThisItem.Mitarbeiter.DisplayName) = Lower(TextInput1.Text),
    false
    )
    )

    This formula checks if the email address of the current item in the gallery is a valid email address using the IsMatch() function with the Match.Email pattern. If the email address is valid, it then compares the lowercase display name of the current item to the lowercase text input value. If they match, the item is included in the filtered gallery; otherwise, it is excluded.

    Note that this formula assumes that the email address of each item in the gallery is stored in a field called "Email" within the "Mitarbeiter" field of each record in the "Berater" data source. You may need to adjust the formula to match the specific structure of your data source.
    If you feel that my response has helped you, please consider giving it a thumbs up and please mark it as the solution. This will help other community members find the solution quickly if they have a similar issue in the future.

  • Community Power Platform Member Profile Picture
    on 05 Apr 2023 at 19:23:25
    Re: Filter a gallery by textinput

    i always get the error The method 'UserPhotoV2' has an invalid value for parameter 'id'

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473