cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
diegomarino
Helper III
Helper III

filter using a dropdown operator

hi,

i'd like to filter a gallery using a dropdown

the problem is that the dropdown value is not a value i want to search, but is the operator

 

example

 

dropdown vaue: =

search textbox: 35

 

so i have selected the "= 35", but in the dropdown i have more than, less then....

 

how can i make a filter formula with that?

25 REPLIES 25

didn't know how to format formula Smiley Embarassed

 

this is my app

this is the applicant screeen (i have "calendar", "deals", "custome" etc etc too), this is a list of applicants. There are more then 50 columns

Cattura.PNG

this is the filter rectangle that i set visible on clicking on the filter icon. I'm building various textboxes and dropdowns to filter columns

 

Cattura1.PNG

 

 

this is the first formula i tried, the gallery show some records but not everyone (i tried with excel)

Cattura2.PNG

 

this is the second formula i tried, but the gallery is empty, even if it gives no error

 

Cattura4.PNG

 thanks for your time

Hi @diego_marino,

Thank you for posting these information...

Ok, let's try this formula instead:

Filter(
    Candidati;
    (
IsBlank(TBcandidatifiltoptftrasferibile.Text)
|| (DPcandidatifiltoptftrasferibile.Selected.Value = "=" && 'Ptf trasferibile personale' = TBcandidatifiltoptftrasferibile.Text)
|| (DPcandidatifiltoptftrasferibile.Selected.Value = "<=" && 'Ptf trasferibile personale' <= TBcandidatifiltoptftrasferibile.Text)
|| (DPcandidatifiltoptftrasferibile.Selected.Value = ">=" && 'Ptf trasferibile personale' >= TBcandidatifiltoptftrasferibile.Text)
) )

Can you test this already and see if it works. Then we will see how to add the conditions on the other fields...

Emmanuel

unfortunely not working. I made some tests

this is working properly

Filter(
    Candidati;
    IsBlank(TBcandidatifiltroptftrasferibile.Text) || 'Ptf trasferibile personale' = Value(TBcandidatifiltroptftrasferibile.Text)
)

when i add this other piece (DPcandidatifiltroptftrasferibile.Selected.Value = "=" &&) it returns nothing, even if it gives me no error

Filter(
    Candidati;
    IsBlank(TBcandidatifiltroptftrasferibile.Text) || (DPcandidatifiltroptftrasferibile.Selected.Value = "=" && 'Ptf trasferibile personale' = Value(TBcandidatifiltroptftrasferibile.Text))
)

hi

with this formula everything is ok

Filter(
    Candidati;
    IsBlank(TBcandidatifiltroptftrasferibile.Text) || 'Ptf trasferibile personale' = Value(TBcandidatifiltroptftrasferibile.Text)
)

when i add that piece it gives me no error but gallery is empty

 

Filter(
    Candidati;
    IsBlank(TBcandidatifiltroptftrasferibile.Text) || (DPcandidatifiltroptftrasferibile.Selected.Value = "=" && 'Ptf trasferibile personale' = Value(TBcandidatifiltroptftrasferibile.Text))
)

Where do you place your filter formula ?

 

What are the possible values that the user can enter in the TBcandidatifiltroptftrasferibile field ?

 

What is the data type of the field 'Ptf trasferibile personale' ?

 

Use the Value() function only if you want to convert a numeric text into a numeric value.

1) the formula is in gallery items

2) TBcandidatifiltroptftrasferibile  is a text input in which user can insert only a number

3) the data type of the field 'Ptf trasferibile personale'  is a number sharepoint column, just changed the type from text to number and eliminated the Value() function

Ok, perfect. Since your last changes have you made a test again on both formulas you tested before ?

yes, i tried this one and it's not working Smiley Sad

 

Filter(
    Candidati;
    IsBlank(TBcandidatifiltroptftrasferibile.Text) || (DPcandidatifiltroptftrasferibile.Selected.Value = "=" && 'Ptf trasferibile personale' = TBcandidatifiltroptftrasferibile.Text)
)

Ok. Firstly, since your textbox TBcandidatifiltroptftrasferibile text property returns a string and is compared with your 'Ptf trasferibile personale' field which is numeric, I would add the Value() function around the TBcandidatifiltroptftrasferibile.Text.

Can you try again the formula with just this and tell me if it works:

Filter(
    Candidati;
    IsBlank(TBcandidatifiltroptftrasferibile.Text) || 'Ptf trasferibile personale' = Value(TBcandidatifiltroptftrasferibile.Text))
)

Then, about your DPcandidatifiltroptftrasferibile dropdown, can you post a capture with the Items property please ? Like this:

Image 10.png

Thank you.

ok i tried

Filter(
    Candidati;
    IsBlank(TBcandidatifiltroptftrasferibile.Text) || (DPcandidatifiltroptftrasferibile.Selected.Value = "=" && 'Ptf trasferibile personale' = Value(TBcandidatifiltroptftrasferibile.Text))
)

not working

 

Cattura.PNG

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (2,917)