Hello, I have a customer table, an installati...

Hello, I have a customer table, an installation table, with several installations per client. My sav form asks me for the client name and I want the following field to be an enumlist of the installations in reference to the client Is it possible ? how?

Thank you

Thank you

0 23 646
  • UX
23 REPLIES 23

tony1
New Member

@Remi_Garson Use a valid_if to create a dropdown help.appsheet.com - Dropdown from Valid_If Dropdown from Valid_If help.appsheet.com

I forgot to specify the entry name refers to a table and the entry instalation refers to another table see the attached drawing table sav

@tony

wow !! it works ! thank you for your help, and for getting me by myself! I understood new things today.

@tony sorry again a little trouble, I was expecting to have a line here:

and I have an exclamation point here

tony1
New Member

The exclamation point means the reference is invalid. The values of a ref column should be key values from the referenced table. Your other problem is probably another manifestation of having an invalid ref value.

@tony

So I create a virtual column ref that should send me the key of the installation table according to the previous 2 conditions: = SELECT (installation [installation ID], and ([name] = [_ THISROW]. [Client], [type] = [_ THISROW]. [Type]))

this formula returns a list and is therefore not compatible with a Ref column whereas a single value can be returned in principle

tony1
New Member

@Remi_Garson If you know that only a single value will match, you can wrap your select expression in ANY:

ANY(SELECT(โ€ฆ))

tony1
New Member

@Remi_Garson You might also be interested in the LOOKUP function, which is just shorthand for ANY(SELECT(โ€ฆ)).

appsheet.com - Lookup Function - How to use the LOOKUP function Lookup Function - How to use the LOOKUP function appsheet.com

@tony

It works but this formula does not work with a ref column, I worked around the problem with a column text [test] then a column ref [test suite] = [test] Is there another best method?

tony1
New Member

@Remi_Garson Can you change your essai column to be a Ref pointing to the correct table?

Thank you, it works! I had to make a mistake when assigning the table

tony1
New Member

@Remi_Garson The usual way to have an EnumList populated by values from another table is with a valid_if. Can you explain why that wonโ€™t work in your case?

@tony

it will also work with a real column instead of the virtual What is the preferred method?

tony1
New Member

@Remi_Garson It will work either way. Virtual columnsโ€™ formulas are always recomputed. Non-virtual columnsโ€™ formulas are only computed when the row itself changes and are written to your sheet. Thereโ€™s no preferred method, since it all depends on your needs.

@tony ok, Iโ€™ll think about it thanks for the help provided

 

 

tony1
New Member

@Remi_Garson Your formula is not using the correct syntax. Please look at the third example in the article that I linked to.

@tony , I tried with this formula: Select(installation[type dโ€™installation], installation[nom]=entretien[nom])

no error in the app but no results in the drop-down menu do I still forget something?

tony1
New Member

@Remi_Garson Your syntax is still wrong. โ€œinstallation[nom]โ€ means โ€œthe entire list of values from the nom column of the installation tableโ€. You probably want something like this instead (you may have to play with it):

[nom] = [_THISROW].[nom]

@tony

how does appsheet make the difference because i have 2 column name in 2 different table?

tony1
New Member

@Remi_Garson Letโ€™s say you have a table called Companies and you put a formula like this into one of the Companies tableโ€™s columns:

SELECT(Customer[Name], [Company Name] = [_THISROW].[Company Name])

  • [Company Name] refers to the column in the Customer table - [_THISROW].[Company Name] refers to the column in the Companies table (the table you are selecting from)
Top Labels in this Space