Sorting in one condition

Can I do different sorting with one condition … like i have a drop down with, option set values: highest and lowest points sorting and date latest or oldest sorting … by putting 3 condtions its done easily, Can it be done with one condition or without
any condition

Yes you can use the “change which field” to dyanamicaly define the field name you want to sort on without haveing to use multiple conditionals.
You can use an optionset with the display name of the sorting, an ascending yes/no attribute, and a field name attribute.

I have tried can you please elaborate more … I have give option set value to change which field and decending a yes/no but it give error that its not a type product … if I use filtered in front search for products( in products i am created date = sort-field date ) then it don’t throw error but still not working


check this its in filtered field name is a date

that will not work :sweat_smile: there’s quite a few things wrong here.

  1. First of all, what are you trying do with the search constraints? Is Field name a date? it should be a text.
    Creation Date = option set field name does not make much sense.

  2. Regardless of that, if you put two search constraints Creation Date = A & Creation Date = B, logically the search will not return any results, because Creation Date cannot equal to A and B simultaneously, unless A = B.

  3. You have created 2 ‘Sort By’ categories. When you create two sorting categories, the list of elements will first be sorted by the first category, and if any elements have the same value for the first category, then these will be sorted by the second.
    A typical example would be sorting events by day of the week and then by time of day, to get the event in chronological order.

This is not what you want to do. You want to have only one sorting category at a time, but let the user switch through them using a dropdown.
Remove the second sorting category. The first category should remain the ‘change which field’ but you should not statically hardcode the Dynamic Field name. Its in the name! It should be dynamic. Set the dynamic field name to ‘Dropdown’s Sorting Type’s value’s field name’ & the descending to ‘Dropdown’s Sorting Type’s value’s Descending’.

The Option Set’s field name has to be the exact field name that you define in the Data Tab, and its case sensitive. It seems like you defined this as a date? It should be a text.
Descending should be a yes/no field
And the display shuold be the name you want to display to the user on the dropdown.

Thanks man it worked. I was new to this thank you for your detailed answer… :grinning: