Hello,
I have added an icon for sorting a gallery by column "SortByColumns" but want to add another for another column but having trouble with the formula. Below is what I have so far. How would I add the second "SortByColumns" for second icon?
I would like to add another icon for "SortByColumns" for "Customer".
SortByColumns(Filter(Search(LIST01, SearchBox.Text, "E_x002d_mail", "Customer", "LISTRMA_x0023_", "Contact"), If(Dropdown1.Selected.Value = "All", true, Status.Value = Dropdown1.Selected.Value), If(Dropdown2.Selected.Value = "All", true, Branch.Value = Dropdown2.Selected.Value)), "LISTRMA_x0023_", If(SortDescending1, Descending, Ascending))
Thanks in advance.
Hi @ShadowTech ,
If you set the second icon to toggle
UpdateContext({SortDescending2:!SortDescending2})
you could do this
SortByColumns(
Filter(
Search(
LIST01,
SearchBox.Text,
"E_x002d_mail",
"Customer",
"LISTRMA_x0023_",
"Contact"
),
If(
Dropdown1.Selected.Value = "All",
true,
Status.Value = Dropdown1.Selected.Value
),
If(
Dropdown2.Selected.Value = "All",
true,
Branch.Value = Dropdown2.Selected.Value
)
),
"LISTRMA_x0023_",
If(
SortDescending1,
Descending,
Ascending
),
"Customer",
If(
SortDescending2,
Descending,
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.
Tried that same implementation but for some reason the second sort button does not execute that function. Nothing happens when clicking the second sort button. Just the first sort button works.
Any ideas?
Thanks.
Hi @ShadowTech ,
Strange, but I have not tried that before, so try this
Sort(
Sort(
Filter(
Search(
LIST01,
SearchBox.Text,
"E_x002d_mail",
"Customer",
"LISTRMA_x0023_",
"Contact"
),
If(
Dropdown1.Selected.Value = "All",
true,
Status.Value = Dropdown1.Selected.Value
),
If(
Dropdown2.Selected.Value = "All",
true,
Branch.Value = Dropdown2.Selected.Value
)
),
LISTRMA_x0023_,
If(
SortDescending1,
Descending,
Ascending
)
),
Customer,
If(
SortDescending2,
Descending,
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.
@WarrenBelz Yeah that doesn't work. Using "SortByColumns(SortByColumns(" doesn't work either.
The syntax structure should be valid - what do you mean by "it does not work" - does the code produce an error?
Also note that this will sort by LISTRMA_x0023_ and then Customer - do want to sort by one or the other ? If so you need another structure with a value (say radio control) with Items ["Customer", "ListRMA"] and would look something like this (and you can go with a single sort button).
Sort(
Filter(
Search(
LIST01,
SearchBox.Text,
"E_x002d_mail",
"Customer",
"LISTRMA_x0023_",
"Contact"
),
If(
Dropdown1.Selected.Value = "All",
true,
Status.Value = Dropdown1.Selected.Value
) &&
If(
Dropdown2.Selected.Value = "All",
true,
Branch.Value = Dropdown2.Selected.Value
)
),
If(
YourRadio.Selected.Value="Customer",
Customer,
LISTRMA_x0023_
),
If(
SortDescending1,
Descending,
Ascending
)
)
Please note all of this is free-typed, so watch commas and brackets etc.
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.
Hi @ShadowTech ,
Just checking if you got the result you were looking for on this thread. Happy to help further if not.
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.
User | Count |
---|---|
204 | |
93 | |
84 | |
47 | |
42 |
User | Count |
---|---|
251 | |
104 | |
104 | |
62 | |
57 |