Hello,
I have a microsoft list link to my power apps, I have columns for cities and incidents in line, these columns are choice column "Yes", "No" or "In progress".
In my apps I have my gallery, listbox1 with cities name in and dropdown1 State for "All", "Yes", "No" and "In progress".
I need to filter my gallery with the cities selected and the State selected.
I can filter for one city, Valencia here, and I don't know how to do it with the city selected in listbox1
If(
Dropdown1.SelectedText.Value="All",
(SortByColumns(Filter([@TestEmilien], StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))),
(SortByColumns(Filter([@TestEmilien], Valencia.Value=Dropdown1.SelectedText.Value), "Title", If(SortDescending1, Descending, Ascending)))
)
I tried with Search:
If(
Dropdown1.SelectedText.Value="All", (SortByColumns(Filter([@TestEmilien], StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))),
(SortByColumns(Search(TestEmilien, dropdown1.SelectedText.Value, ListBox1.Selected.Value), "Title", If(SortDescending1, Descending, Ascending))))
but I have an error : The function "Search" has some invalid arguments
Solved! Go to Solution.
@Yuna-Evita If you don't want to change the design, fine. Then you have to check all the field one-by-one.
If(
Dropdown1.SelectedText.Value="All",
(SortByColumns(Filter([@TestEmilien], StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))),
(SortByColumns(Filter([@TestEmilien], (Valencia.Value=Dropdown1.SelectedText.Value || Auckland.Value=Dropdown1.SelectedText.Value || keep adding other fields... ), "Title", If(SortDescending1, Descending, Ascending)))
)
@Yuna-Evita You should have only one column for the cities and not one column for each city. You can call it City and store the name of the city there. Then your formula will be,
If(
Dropdown1.SelectedText.Value="All",
(SortByColumns(Filter([@TestEmilien], StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))),
(SortByColumns(Filter([@TestEmilien], City.Value=Dropdown1.SelectedText), "Title", If(SortDescending1, Descending, Ascending)))
)
Yes but I don't need to store the city's name, I need to store the state for each cities for each incidents
@Yuna-Evita Sorry not very clear. Can you share a screen shot of the List settings with the Column names.
In my list, I stock incident, and I have a lot of column for a lot of cities, the choice column with city's name can contain "Yes", "No" or "In progress" that what I called the state
@Yuna-Evita This is very bad design. Sorry!
If you have one column for each city, if you want to add more citis later, you have to change the SP List and your PowerApps. It will become unmanageable. Moreover, you don't have to do it this way.
Just have ONE choice column called City and then a choice coulmn called CitySate to know which state that city is in ("Yes", "No" or "In progress") and then another column CityDescription for the description.
I know for the design no probleme,
But I'm not sure to understand what do you mean by then
@Yuna-Evita If you don't want to change the design, fine. Then you have to check all the field one-by-one.
If(
Dropdown1.SelectedText.Value="All",
(SortByColumns(Filter([@TestEmilien], StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))),
(SortByColumns(Filter([@TestEmilien], (Valencia.Value=Dropdown1.SelectedText.Value || Auckland.Value=Dropdown1.SelectedText.Value || keep adding other fields... ), "Title", If(SortDescending1, Descending, Ascending)))
)
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
261 | |
123 | |
86 | |
81 | |
70 |