i am creating a collection with 4 column names and wanted to sort it

i am creating a collection with 4 column names and wanted to sort it
Hi @KDAI
To create a sorted collection based on empid, you should first use Collect to create the collection and then use Sort to sort that collection. Here's how you can do it:
Create the collection with Collect:
Clear(empwithsal); // Clear the collection if it already exists
ForAll(
empid,
Collect(
empwithsal,
{
empid: ID,
empnumber: 'empnumbers',
emprole: role,
joindate: joindate
}
)
);
Sort the collection and store it in a new collection or variable:
ClearCollect(
SortedEmpWithSal,
Sort(
empwithsal,
empid,
SortOrder.Descending
)
);
Thanks!
If my response has been helpful in resolving your issue, I kindly request that you consider clicking "Accept as solution" and "giving it a thumbs up" as a token of appreciation.