Hi Appsheet, Would it be possible to make to...

(Diogenes ASBL - VZW) #1

Hi Appsheet,

Would it be possible to make to Valid_If rules?

I would use one to make depended dropdowns or column restrictions. A second one would be handy to use orderby () for example…

Greetings, Bram

(Tony Fader) #2

Hi @Diogenes_ASBL_VZW. I don’t understand your question, can you say more and/or give an example?

(Diogenes ASBL - VZW) #3

Hi Tony,

Thx for your replay. Eg:

Dependend dropdown: Column [country] with enumlist valid if = eu coutries[countries] Column [city] with reflist valid if = eu countries[cities] So appsheet will recognise the dependency of both columns.

Now I also want to use the valid if rule to give an order Orderby() or maybe a restriction: eg: [city] is only valid when the user gave his name: valid if= isnottblank[username]

You see what i mean with the combination?

(Tony Fader) #4

@Diogenes_ASBL_VZW The “dependent dropdown” behavior is really just a slightly complex formula that AppSheet inserts into your valid_if for you. If you want to combine it with something else, you’ll need to explicitly write out the dependent dropdown formula and combine it with AND or insert an ORDERBY.

This page gives an example of the dependent dropdown formula: help.appsheet.com - Dependent Dropdown

“Strictly for an expression afficionado, here is the full underlying AppSheet expression: IN( [_THIS], SELECT(Regions[Country], [_THISROW].[Lead Region] = [Region]))”

You’ll need to write something like:

AND(ISNOTBLANK([Email column]), dependent formula goes here) Dependent Dropdown help.appsheet.com

(Diogenes ASBL - VZW) #5

Ok thx a lot @tony

Combined with orderby can the formula be something like: Orderby(dependent formula,[ordercolumn])?

(Diogenes ASBL - VZW) #6

Hi @tony,

I tried this formula to order my dependent column: =ORDERBY( List Lieux[Lieu], IN([_THIS],SELECT(List Lieux[Lieu],[_THISROW].[Sorte Lieu]=[Sorte Lieu])),True, [Nombre Interventions],True)

In this case the list from column [Lieu] is ordered via [Nombre Interventions] But the list is not dependent anymore of the value of [Sorte Lieu]

Is there a way to combine the expression orderby with the dependent dropdown expression?

Thx a lot, Bram

(Diogenes ASBL - VZW) #7

I made it!! Nice …

Here is a formula that works to order a dependent dropdown column:

=IN([_THIS], Orderby( SELECT(List Lieux[Lieu],[_THISROW].[Sorte Lieu]=[Sorte Lieu]), [Nombre Interventions],True, [Lieu],False ))

Cool …

(Diogenes ASBL - VZW) #8

@tony

The extended version: a dependent dropdown column that is orderd by its number of selections [Nombre Interventions] by the user and with the restriction that the user selected the button “Avec la personne” … works perfect!

=IN([_THIS], Orderby( SELECT(List Lieux[Lieu], AND([_THISROW].[Sorte Lieu]=[Sorte Lieu], Contains([Choix], “Avec la personne”))), [Nombre Interventions],True, [Lieu],False ) ) Translate