Question with SORT

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?

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

https://help.appsheet.com/en/articles/961544-dropdown-from-valid_if

2 Likes

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
)
2 Likes

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

2 Likes

this worked, but now I’m unable to create new from the dropdown :disappointed_face:

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

2 Likes

Thank you very much!

1 Like

Yep

1 Like