I have a valid_if expression using select() that drops down a list from another spreadsheet.
What I want to do is sort the dropdown based on a column value, preferably the ‘date’.
I tried wrapping up the select expression with orderby() using the [Date] column, but I get shown a message that orderby doesn’t have the valid inputs.
I saw that an exact same problem was posted by some other person, the solution to which was suggested as:
Try generating a sorted list using the Suggested values property for the column.
which seemed to have worked for the seeker.
But I don’t know how to properly write the expression in the suggested values field.
The select expression in valid_if :
select(RMC Bill entry[Computed], and(([Which Company?]=[_THISROW].[RMC Supplier]), [Paid?]=“Unpaid”))
I tried using orderby(select(RMC Bill entry[Computed], and(([Which Company?]=[_THISROW].[RMC Supplier]), [Paid?]=“Unpaid”)), [Date]) to no avail.
The [Date] column is within the table RMC Bill entry.
[Computed] is not the key, its a virtual column which is the concatenation of a number of columns from the concerned table; just something that I NEED in the drop-down.
Replacing it with the key column will show the values from the key column in the dropdown, because effectively we are ‘Selecting’ the key column, isn’t it?
Replacing it with the key column will show the values from the key column in the dropdown, because effectively we are ‘Selecting’ the key column, isn’t it?
For the ORDERBY() to work, it MUST have the key columns in order to reference the row, retrieve the [Date] value an then apply the sorting.
If you are using the dropdown for column of “Ref” type, then in most cases you want the key value returned. Then you should be setting the Label column of that referenced table to be used as the display value.
I have a valid_if expression using select() that drops down a list from another spreadsheet.> > What I want to do is sort the dropdown based on a column value, preferably the ‘date’.
You cannot sort a list of non-Ref values by anything but the values themselves.
Theoretically, you could get the desired-order list of column values using a bulk dereference:
[Rows by Date][Computed]
(Note there is no period between the two column references.)
I say “theoretically” because I don’t have enough experience with bulk dereferences to say with confidence how they behave, but I would expect this to work.
Thanks a million @Steve - I had to adjust it slightly to work for all cases (namely: DO NOT allow more than one child entry per parent, but DO allow editing of existing child entry).