Question with SORT

NCD
Silver 2
Silver 2

I have a Column Type Enum Base type Ref. 

When I click the dropdown menu, I would like to see the newest one created to be at the top.

How and where would I put this expression?

Solved Solved
0 7 161
3 ACCEPTED SOLUTIONS

You would need to have a way to get the newest one, generally speaking this is made by adding a column of datetime to your table so that every row will have a timestamp of when it was created using NOW() as it initial value.

Now, the way to get the newest one by default is by sorting by RowNumber.

Do this on Valif_If for your Enum

ORDERBY(
  Table[ID],
  [_RowNumber],
  0=0
)

View solution in original post

Hello @NCD, you can put this expression in your validif() column configuration, like this:

ORDERBY(Products[Product ID], [Product Price], TRUE)

 This would sort the "Products" table based on their price in descending order, replace the table and sort column and see if it is descending (TRUE) or ascending (FALSE) order that suits you, I never manage to remember which is which !

Source: https://help.appsheet.com/en/articles/2357312-orderby

View solution in original post

for solving that, place the same exact expression in suggestedvalues() instead.

View solution in original post

7 REPLIES 7

You would need to have a way to get the newest one, generally speaking this is made by adding a column of datetime to your table so that every row will have a timestamp of when it was created using NOW() as it initial value.

Now, the way to get the newest one by default is by sorting by RowNumber.

Do this on Valif_If for your Enum

ORDERBY(
  Table[ID],
  [_RowNumber],
  0=0
)

this worked, but now I'm unable to create new from the dropdown 😞

Hello @NCD, you can put this expression in your validif() column configuration, like this:

ORDERBY(Products[Product ID], [Product Price], TRUE)

 This would sort the "Products" table based on their price in descending order, replace the table and sort column and see if it is descending (TRUE) or ascending (FALSE) order that suits you, I never manage to remember which is which !

Source: https://help.appsheet.com/en/articles/2357312-orderby

for solving that, place the same exact expression in suggestedvalues() instead.

Thank you very much!

Yep

Top Labels in this Space