I have a question on Sorting in widget

Black Coder
Tera Guru

We have a widget for Questions and answers in different languages. We are in the need to sort the question based on user's  prefered languages. if the user's preference is English then all the English questions will be sorted first and other language questions come later. likewise if the user's preferecnce is French then all the French question should be sorted first and other language questions should be shown later. For the sorting we have to user "Language" field.

Below screenshot is the table for that widget

 

How to achieve this sorting

 

Sorting.PNG

1 REPLY 1

p_kanczugowski
Tera Guru

Hi @Black Coder, SN sorting is a simple alphanumeric order setting, either a-z or z-a. Perhaps you could consider multiple custom views and/or nav entries that would lead to specific languages. Another option would be to have a dynamic filter that would be based on the user's current language, and only show them their answers. You could have another one that would FITLER those, and show "other" languages.

 

If, however, you really want to use the sorting function and use a field as a basis of dynamic "preference" of the records in terms of how they appear on a list, you could create a calculated field and use that to do the sorting.

 

p_kanczugowski_0-1710154633649.png

 

However, I would recommend against that, since it's a very resource-heavy process (the field must be calculated every time someone loads the record).

 

Please mark this response as useful and the question as solved if the issue has been solved. Thank you!