Hi, I have a gallery with a collection as the datasource. I have 2 dropdowns and a textinput. The ArrngDrop dropdown and DocDrop1 dropdown only filter if both dropdowns have a selection, however only the ArrngDrop filters. I just wanted to be able to have the ability to for the user to filter with either one or both dropdowns, as well as the textinput (ArrngSrch.Text). Any advice would be much appreciated.
(Sort(Filter(ProcedureCollect,Arrangement = Label90.Text && Engine = Label91.Text, Len(ArrngDrop.Selected.Value)= 0 Or Len(DocDrop1.Selected.Value)=0 || ComponentType = ArrngDrop.Selected.Value || DocDrop1.Selected.Value
, Or(StartsWith(ComponentType, ArrngSrch.Text))),Sequence,SortOrder.Ascending))
Thanks WarrenBelz, i did try Or, but diddnt have the bracket in front of Startswith. Cheers
Hi @Matt383 ,
Needs Or not And as well as some bracketing
Sort(
Filter(
ProcedureCollect,
Arrangement = Label90.Text &&
Engine = Label91.Text &&
(
Len(ArrngDrop.Selected.Value)= 0 ||
ComponentType = ArrngDrop.Selected.Value
) &&
(
Len(DocDrop1.Selected.Value)=0 ||
DocumentType = DocDrop1.Selected.Value
) &&
(
StartsWith(
ComponentType,
ArrngSrch.Text
) ||
StartsWith(
PN_Arrangement,
ArrngSrch.Text
)
),
Sequence,
SortOrder.Ascending
)
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.
MVP (Business Applications) Visit my blog Practical Power Apps
Hi WarrenBelz,
Just in regards to having the textinput search, to search from 2 different columns (e.g. ComponentType and PN_Arrangement . I have tried a few different variations but with no luck. I thought i would be just able to use Startswith(ComponentType,ArrngSrch.Text),Startswith(PN_Arrangement,ArrngSrch.Text), howerver the dropdowns work as they should but no response from the text search. Same outcome with below
Sort(
Filter(
ProcedureCollect,
Arrangement = Label90.Text &&
Engine = Label91.Text &&
(
Len(ArrngDrop.Selected.Value)= 0 ||
ComponentType = ArrngDrop.Selected.Value
) &&
(
Len(DocDrop1.Selected.Value)=0 ||
DocumentType = DocDrop1.Selected.Value
) &&
StartsWith(
ComponentType,
ArrngSrch.Text
) &&
StartsWith(
PN_Arrangement,
ArrngSrch.Text
)
),
Sequence,SortOrder.Ascending
)
Thanks WarrenBelz
Hi @Matt383 ,
You are missing the field that DcoDrop1 needs to filter - you also need some proper bracketing between And/Or arguments
Sort(
Filter(
ProcedureCollect,
Arrangement = Label90.Text &&
Engine = Label91.Text &&
(
Len(ArrngDrop.Selected.Value)= 0 ||
ComponentType = ArrngDrop.Selected.Value
) &&
(
Len(DocDrop1.Selected.Value)=0 ||
YourFieldHere = DocDrop1.Selected.Value
) &&
StartsWith(
ComponentType,
ArrngSrch.Text
)
),
Sequence
)
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.
MVP (Business Applications) Visit my blog Practical Power Apps