Hello there!
I'm making an app which has a gallery that shows a numbers of items that are delegated into categories. However I have run into an issue.
I had the search field working when I didn't need to have a blank item choice in the dropdown menu, however now that I do, the "If" Statement is occupied so to speak.
I would like it to work like this: If anything is in the search field, it should filter the items in the gallery based on that, if not, filter it based on the dropdown.
Below is a PNG Attached explaining the different elements
Thanks in Advance!
Regards
Tobias SQ Andersen
Solved! Go to Solution.
Hi @TobiasSQA ,
Based on your description: If anything is in the search field, it should filter the items in the gallery based on that, if not, filter it based on the dropdown.
I have made a test for your reference.
1. Here is my SharePoint List.
2. Select the Gallery Control and try to apply the formula like this:
If(
!IsBlank(TextInput1.Text),
Filter(
datasource,
TextInput1.Text in columnname
),
If(
!IsBlank(Dropdown1.Selected.Value),
Filter(
datasource,
Dropdown1.Selected.Value = choicecoulumnname.Value
),
datasource
)
)
Result Screenshots:
In addition, if you want the search bar and dropdown to work together, maybe you could try the following formula:
Search(
If(
!IsBlank(Dropdown1.Selected.Value),
Filter(
datasource,
Dropdown1.Selected.Value = choicecolumnname.Value
),
datasource
),
TextInput1.Text,
"columnname"
)
Result Screenshot:
Best Regards,
Charlie Choi
Hi @TobiasSQA ,
Sorry, could you please provide your formula separately? The formula in your screenshot is not very clear.
Best Regards,
Charlie Choi
Hi @TobiasSQA ,
Based on your description: If anything is in the search field, it should filter the items in the gallery based on that, if not, filter it based on the dropdown.
I have made a test for your reference.
1. Here is my SharePoint List.
2. Select the Gallery Control and try to apply the formula like this:
If(
!IsBlank(TextInput1.Text),
Filter(
datasource,
TextInput1.Text in columnname
),
If(
!IsBlank(Dropdown1.Selected.Value),
Filter(
datasource,
Dropdown1.Selected.Value = choicecoulumnname.Value
),
datasource
)
)
Result Screenshots:
In addition, if you want the search bar and dropdown to work together, maybe you could try the following formula:
Search(
If(
!IsBlank(Dropdown1.Selected.Value),
Filter(
datasource,
Dropdown1.Selected.Value = choicecolumnname.Value
),
datasource
),
TextInput1.Text,
"columnname"
)
Result Screenshot:
Best Regards,
Charlie Choi
Hey Charlie
Once again this worked perfectly, thank you so much for the stellar assistance! You're almost doing too much 🙏
Kind Regards,
TobiasSQA