ENUM with conditions

Hello,

I'm trying the setup an ENUM with a filter that conditions another column.

I'm also new to this so please let me know what information is usually found within requests.

Thanks

Solved Solved
0 19 405
1 ACCEPTED SOLUTION

Aurelien
Google Developer Expert
Google Developer Expert

ok. If you have a ACTION table, then make your column "Action" from the table JOURNAL of type Ref, source table ACTION.

If Description is the text you want the user to see on a dropdown, tick the Label property on the column Description in your table ACTION.

This column will then be displayed to users at any place, any table, that will refer to your action.

For illustration, here is a GIF I made: https://share.getcloudapp.com/DOu47zqe

For reference:

https://help.appsheet.com/en/articles/961466-row-labels

If you are familiar with Label property and are willing to display additional description, then you may want to use a dereference expression. That would be a new virtual column with expression:

Aurelien_0-1651555050351.png

 

 

[ACTION].[Description]

 

For reference:

https://help.appsheet.com/en/articles/1090811-dereference-expressions

 

View solution in original post

19 REPLIES 19

Aurelien
Google Developer Expert
Google Developer Expert

Hi @MartinCousineau 

 

The key-words you are looking for are "dependent dropdown".

Here:

https://help.appsheet.com/en/?q=dependent+dropdown

 

Make sure you have this kind of settings:

Aurelien_0-1650554032378.png

Also, a sample app:

https://www.appsheet.com/templates/How-to-create-a-dropdown-menu-with-values-that-depend-on-earlier-...

 

 

 

Hi,

That's exactly what I was looking for. One more question if I may. If the
dependent dropdown only has one answer, is it possible to have it
automatically select that answer?

Thanks again for your help


------------------------------


Martin Cousineau

GESTION EUROPE I GESTIONNAIRE IMMOBILIER

t:819-923-5329 I e:9235329@gestioneurope.com <6965896@gestioneurope.com>

Aurelien
Google Developer Expert
Google Developer Expert

Bonjour Martin

 

Yes ==> initial Value ๐Ÿ˜‰

Example:

ANY(yourListExpressionHere)

Hello,

Setting the valid if constraint in the initial value doesn't select the
option available. It doesn't actually seem to do anything.

To clarify, I have it setup as a dependent dropdown through the valid if
section. If there is only one option within that dropdown, is it possible
to have it automatically selected.

Thanks


------------------------------


Martin Cousineau

GESTION EUROPE I GESTIONNAIRE IMMOBILIER

t:819-923-5329 I e:9235329@gestioneurope.com <6965896@gestioneurope.com>

I misexpressed, sorry.

Valid_If ==> your constraint expression, if possible with a FILTER() expression

Initial value ==> expression like this:

IFS(COUNT(YourFilterExpression)=1,
  ANY(TOP(YourFilterExpression,1))
)

 

Hello,

I still can't seem to get it to work. My initial expression isn't a filter
but a column in the valid if (to create a dependant drop-down).

When I click on my drop-down there's only one answer, but it doesn't auto
select it.

Thanks again and sorry for my lack of understanding.

Aurelien
Google Developer Expert
Google Developer Expert

Can you share your initial value expression and your valid-if expression ?

And a screenshot of your table structure (columns, from the app editor)

Hello,

Here's the valid_if for the AUTRES column : ACTION[ARTICLE]
Here's the valid_if for the ACTION column : ACTION[ACTION]
Here's the valid_if for the DESCRIPTION column : ACTION[DESCRIPTION]
Here's the initial value for the DESCRIPTION column
: IFS(COUNT(ACTION[DESCRIPTION])=1, ANY(TOP(ACTION[DESCRIPTION],1)) )

Thanks for your help

------------------------------


Martin Cousineau

GESTION EUROPE I GESTIONNAIRE IMMOBILIER

t:819-923-5329 I e:9235329@gestioneurope.com <6965896@gestioneurope.com>

can you provide the table structure screenshot as well ?

I'M unsure if this is what you're looking for. Let me know if it's not.

Thanks


------------------------------


Martin Cousineau

GESTION EUROPE I GESTIONNAIRE IMMOBILIER

t:819-923-5329 I e:9235329@gestioneurope.com <6965896@gestioneurope.com>

Aurelien
Google Developer Expert
Google Developer Expert

I think you are answering directly from your email service. 

There is no image attached.

Can you try from the google cloud community service ?

Sorry. Let me know if that's what your looking for.

ThanksScreenshot 2022-04-26 1.08.27 PM.png

Aurelien
Google Developer Expert
Google Developer Expert

This is it. I would need the first rows of this. Where the "key" property is ticked actually.

Here you go

Screenshot 2022-04-26 1.27.33 PM.png

Is the latest image what you were looking for?

Aurelien
Google Developer Expert
Google Developer Expert

Oops sorry, I got stuck by somehing else and totally forgot to get back to you.

Yes indeed, though I don't see your table name.

Let's say its name is "JOURNAL".

You must have in mind that filter expression are based on the key-column. In your case, the "ID".

I assume you have another table called ACTION. If not, I encourage you to do so. Similarly, I assume you have a table called ARTICLE and another called DESCRIPTION.

Each of these are to be considered as entities in AppSheet.

About DESCRIPTION table, here are the columns I would expected if each description is supposed to be available for one action only.

- key_Description ==> Type Text, Key property ON, initial value UNIQUEID()

- description ==> Type Text, Label property ON

- action ==> Type Ref, source table ACTION

Also, I assume you had a look to the link I provided in my first answer, about dependent dropdown ? Everything is explained there.

So, when you write this:

Here's the valid_if for the AUTRES column : ACTION[ARTICLE]
Here's the valid_if for the ACTION column : ACTION[ACTION]
Here's the valid_if for the DESCRIPTION column : ACTION[DESCRIPTION]
Here's the initial value for the DESCRIPTION column
: IFS(COUNT(ACTION[DESCRIPTION])=1, ANY(TOP(ACTION[DESCRIPTION],1)) )

I would like to correct it with:

In the table JOURNAL:

Here's the valid_if for the AUTRES column : AUTRES[key_Column_Autres]
Here's the valid_if for the ACTION column : ACTION[key_Column_Action]
Here's the valid_if for the DESCRIPTION column  :

FILTER("DESCRIPTION", [Action]=[_THISROW].[Action])

Here's the initial value for the DESCRIPTION column

IFS(
  COUNT(
    FILTER("DESCRIPTION", [Action]=[_THISROW].[Action])
  )=1,
    ANY(FILTER("DESCRIPTION", [Action]=[_THISROW].[Action]))
)

Let me know if that matches your data structure. If not, can you provide further screenshot and elements on your column structure ?

Hello,

 

I don't have a description table. I might be going at this wrong. I'm looking for the description of the action to automatically popup once the action is selected.

Thanks

Aurelien
Google Developer Expert
Google Developer Expert

ok. If you have a ACTION table, then make your column "Action" from the table JOURNAL of type Ref, source table ACTION.

If Description is the text you want the user to see on a dropdown, tick the Label property on the column Description in your table ACTION.

This column will then be displayed to users at any place, any table, that will refer to your action.

For illustration, here is a GIF I made: https://share.getcloudapp.com/DOu47zqe

For reference:

https://help.appsheet.com/en/articles/961466-row-labels

If you are familiar with Label property and are willing to display additional description, then you may want to use a dereference expression. That would be a new virtual column with expression:

Aurelien_0-1651555050351.png

 

 

[ACTION].[Description]

 

For reference:

https://help.appsheet.com/en/articles/1090811-dereference-expressions

 

Perfect. Thanks for your help

Top Labels in this Space