Hello Everyone,
I have data share point list with name "Incoming".
and I have column "Work Place" with many value inside,
but I want to filter "Work Place" in two criteria (same column) and show in my data table, below here my code
Filter(
Incoming,
StartsWith(
KodeID,
TextInputKodeIDShi.Text
) && StartsWith(
'Work Place',
Label021.Text
) && StartsWith(
'Work Place',
Label029.Text
)
)
So in my data table, Power Apps didn't find any data..
Anyone know how to filter two criteria in same column?
Solved! Go to Solution.
Hi @dianhudayahr ,
Just some more bracketing required
Filter(
Incoming,
(
IsBlank(TextSearchBox1.Text) ||
StartsWith(
KodeID,
TextInputKodeIDShi.Text
)
) &&
(
(
IsBlank(Label021.Text) ||
StartsWith(
'Work Place',
Label021.Text
)
) ||
(
IsBlank(Label029.Text) ||
StartsWith(
'Work Place',
Label029.Text
)
)
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
There is no point giving two criteria. If you have large dataset and want to filter on same columns. You can try this:
Filter( Filter( Incoming, StartsWith( KodeID, TextInputKodeIDShi.Text ) && StartsWith( 'Work Place', Label021.Text ) ),StartsWith( 'Work Place', Label029.Text ) )
This will first give result from Lable021. and give this filtered list as a source to Lable1029.
Hi Zmansuri,
I think so, I already trying your code, and still cannot find any data.
it seem difficult with AND function also in filter same column,
So I try combine with OR function in there filter, below the code.
Filter(
Incoming,
StartsWith(
KodeID,
TextInputKodeIDShi.Text
) && StartsWith(
'Work Place',
Label021.Text
) || StartsWith(
'Work Place',
Label029.Text
)
)
From there, I got a good result the data is show and working.
but still not perfect, because every I type item in -> TextInputKodeIDShi.Text its not working correctly,
I still cant find out to solving this situation..
Anyone to know, please give advice.
Thank you very much.
My assumption is to filter to use AND if search exists. The below code search KodeID and Work Place with 2 filter criteria.
With(
{
sData: Filter(
Incoming,
IsBlank(TextSearchBox1.Text) || StartsWith(
KodeID,
TextInputKodeIDShi.Text
)
)
},
If(
!IsBlank(Label021.Text),
Filter(
sData,
StartsWith(
'Work Place',
Label021.Text
)
),
If(
!IsBlank(Label029.Text),
Filter(
sData,
StartsWith(
'Work Place',
Label029.Text
)
),
sData
)
)
)
Note: sData is just a variable to avoid delegation
Hi @dianhudayahr ,
Just some more bracketing required
Filter(
Incoming,
(
IsBlank(TextSearchBox1.Text) ||
StartsWith(
KodeID,
TextInputKodeIDShi.Text
)
) &&
(
(
IsBlank(Label021.Text) ||
StartsWith(
'Work Place',
Label021.Text
)
) ||
(
IsBlank(Label029.Text) ||
StartsWith(
'Work Place',
Label029.Text
)
)
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
This still show filter one criteria, solution is used more bracket required.. just check the latest reply.
Thank you friend.
User | Count |
---|---|
261 | |
128 | |
99 | |
48 | |
47 |