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 Automate / Problem on filter meth...
Power Automate
Unanswered

Problem on filter method in a gallery

(0) ShareShare
ReportReport
Posted on by 12

Hi,

I have a problem with my gallery and the function "filter" who help me to find the best recording on my Sharepoint's list.

I create 5 different filters (2 text input, 1 date picker and 2 combobox who used metadata) this filter change my items on my gallery. If all of this field are blank, the gallery return my table "Suivi", if not, it's return just the records with my condition (like Name="TextInputeName.Text". I try different combinations with their fields and I find this way. When my condition of filter take these 2 expressions :

  • ComboBox1.Selected.Label in Site.Value
  • ComboBox1_1.Selected.Label in Type_x0020_d_x0027__x00e9_v_x00e.Value

my function filter doesn't work. The data of these fields are the 2 metadata. 

There is the code of my Gallery Item

If(ChampsSearch=true;Sort(Suivi;Date_x0020_de_x0020_l_x0027__x00;SortOrder.Descending);Filter(Suivi;TextInput1.Text in Nom; TextInput1_1.Text in Pr_x00e9_nom;Text(DatePicker1.SelectedDate;DateTimeFormat.ShortDate;"fr-FR") in Date_x0020_de_x0020_l_x0027__x00;ComboBox1.Selected.Label in Site.Value; ComboBox1_1.Selected.Label in Type_x0020_d_x0027__x00e9_v_x00e.Value))tem 

 and this second part of code is put on the OnChange of all of my filter fields.

UpdateContext({ChampsSearch:(IsBlank(TextInput1.Text) And IsBlank(TextInput1_1.Text) And IsBlank(DatePicker1.SelectedDate) And IsBlank(ComboBox1.Selected.Label) And IsBlank(ComboBox1_1.Selected.Label))})

Ask my if you want other precision on this case, because I don't know why when I put this 2 expressions together it's doesn't work.

Thanks you for reply.

Categories:
I have the same question (0)
  • v-xida-msft Profile Picture
    on at

    Hi @ClemParpa,

     

    Could you please share a bit more about your PowerApps app's configuration?

     

    I think there is something wrong with the formula within the Items property of your Gallery control and OnChange property of all your filter fields. 

     

    Please take a try with the following formula within Items property of Gallery control and OnChange property of all your filter fields:

    The Items property of Gallery control set to following formula:

    If(ChampsSearch=true;Sort(Suivi,Date_x0020_de_x0020_l_x0027__x00,SortOrder.Descending);Filter(Suivi,TextInput1.Text in Nom&&TextInput1_1.Text in Pr_x00e9_nom&&Text(DatePicker1.SelectedDate,DateTimeFormat.ShortDate,"fr-FR") in Date_x0020_de_x0020_l_x0027__x00&&ComboBox1.Selected.Label in Site.Value&& ComboBox1_1.Selected.Label in Type_x0020_d_x0027__x00e9_v_x00e.Value))

    The OnChange property of all your filter fields set to following formula:

    UpdateContext({ChampsSearch:IsBlank(TextInput1.Text) && IsBlank(TextInput1_1.Text) && IsBlank(DatePicker1.SelectedDate) && IsBlank(ComboBox1.Selected.Label) && IsBlank(ComboBox1_1.Selected.Label)})

    The And is a function rather than an operator in PowerApps, if you want to concatenate multiple conditions within your formula, please consider take a try with && operator.  More details about And function in PowerApps, please check the following article:

    And function in PowerApps

     

    More details about Operators in PowerApps, please check the following article:

    Operators in PowerApps

     

     

    Best regards,

    Kris

  • ClemParpa Profile Picture
    12 on at

    Hi @v-xida-msft

    Thanks a lot for your reply but I have some little questions for you.

    I have begin to developp on PowerApp since 1 month and on the website's you give, they say "The And function returns true if all of its arguments are true. The && operator is equivalent to And". So I don't know how to do the difference between "And" and "&&" or "||" and "Or" etc, because for me "&&" and "And" do they same things but there is just a different way to write.

    I try with your code and I don't have error like before I have. But there is not the way I believe, because I would like to search with for exemple the Name and Site or just with the Name... For me I just to change "&&" with "||" for the Or condition. We don't need all filter fields completed to filter the gallery. (I do not know if I'm clear because my English is pretty approximate). The filter fields are already with the right code for me because my variable 'ChampsSearch' change to false when I complete one field.

    Thanks  ! 

     

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 378 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 305 Super User 2025 Season 2

#3
Expiscornovus Profile Picture

Expiscornovus 155 Most Valuable Professional

Last 30 days Overall leaderboard