cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jbaggett
Helper I
Helper I

Filter Collection Blank Text input not showing all items

Hello,

 

I am having trouble figuring out the syntax for my problem. I have figured out the error and why it is happening, but I cannot figure out the correct way to get around it. 

 

APP:  Users type information into fields and save in sharepoint list. Later go to an edit item page, where a gallery shows a collection of the sharepoint list and can be filtered using textinput fields. There are 6 possible filter fields. 

 

PROBLEM: User leaves field blank at "add item" stage. When navigating to edit page, item with blank field does not show on gallery. 

Example: Latest item ID number should be 534 but does not show because SLNumber field was left blank, intentionally. SLNumber is a filter textinput field. 

ASSUMPTION: By process of elimination, I found that this is caused only by the "Filter(Collection...." function. I think I need some sort of IF function. (If SLNumber is blank then do not filter using SLNumtextinput box)

Can anyone help me with the correct wording? 

jbaggett_0-1602082762196.png

 



1 ACCEPTED SOLUTION

Accepted Solutions
SkiDK
Solution Sage
Solution Sage

Hi @jbaggett 

It's basically as you're assuming. By using Or you can choose whether to filter on blank value or not. As below, if the value is blank, then it will not filter, and if the value is not blank, the filtering part will do its job.

 

Filter(
  ColEng,
  Or(
    IsBlank(SLnumInput_1),
    SLnumInput_1.Text in SLNumber
  ),
  Or(
    ...
  ),
  ...
)

 

 Hope this helps.

View solution in original post

2 REPLIES 2
SkiDK
Solution Sage
Solution Sage

Hi @jbaggett 

It's basically as you're assuming. By using Or you can choose whether to filter on blank value or not. As below, if the value is blank, then it will not filter, and if the value is not blank, the filtering part will do its job.

 

Filter(
  ColEng,
  Or(
    IsBlank(SLnumInput_1),
    SLnumInput_1.Text in SLNumber
  ),
  Or(
    ...
  ),
  ...
)

 

 Hope this helps.

Thanks for the quick response! That worked perfectly. I don't think I would have ever figured that out. 

 

My actual formula was slightly different since it was the collection data that was empty and not he textinput box.

 

Filter(
  ColEng,
  Or(
    IsBlank(SLNumber),
    SLnumInput_1.Text in SLNumber
  )
)

 

But the theory behind it was the same. Thanks again!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,938)