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?
Solved! Go to Solution.
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.
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!