Autopopulate a Field based on a previous Enumlist select values (multiselect)

Hi all,

I have quite a similar problem to this thread: LINK.

I have the following:

  • Table "Source" with columns "A", "B" ,"C"
  • Table "Dropdown" with columns "Ax", "By", "Cz".

Columns "Cz" ist just a column that are the initials or a shortname of the fields in Column "By".

Event 1:Column "A" (from Table Source) is a Dropdown field. (Type: Text)

Under Data Validity/Valid IF: Sort(Dropdown[Ax], false), my users must select a single value from that list.

Event 2: Column "B" (from Table Source) is a conditional Dropdown field. It should only show to the user values which were selected in Column "A". (Type: Enumlist /Base type: List / Input mode: Dropdown / Item Separator: ;). 

Under Autocompute/Suggested Values: Select(Dropdown[By],[_THISROW].[Ax]=[A])

Event 3: What I want to do now is to have an autopopulated field in Column "C" based on the selection in Column "B" both in Table Source. It should only display the Initials/Acronyms located in Table Dropdown "Cz"

Under Autocompute/Suggested Values: SPLIT(LOOKUP([_THISROW].[Column "B"], "Dropdown", "By", "Cz"),";")

However, it does not work. Whenever I select a single field from Column "B" in Event 2, I do get the autopopulated field on Column "C". Once I select more than one, i get the value: NULL.

I am aware there is a mistake. Any help, highly appreciated.

Solved Solved
0 4 174
1 ACCEPTED SOLUTION


@SkrOYC wrote:

Select( Dropdown[Cy], IN( [Bx], [_THISROW].[B] ) )


Sorry, I messed the column names:

Select(
  Dropdown[Cz],
  IN(
    [By],
    [_THISROW].[B]
  )
)

View solution in original post

4 REPLIES 4


@Romulo88 wrote:

Event 1:Column "A" (from Table Source) is a Dropdown field. (Type: Text)


If it's going to be a Dropdown, I suggest to make it Enum Basetype Text


@Romulo88 wrote:

Event 2: Column "B" (from Table Source) is a conditional Dropdown field. It should only show to the user values which were selected in Column "A". (Type: Enumlist /Base type: List / Input mode: Dropdown / Item Separator: ;). 


This also seems a little odd, shouldn't be EnumList Basetype Text?


@Romulo88 wrote:

Under Autocompute/Suggested Values: Select(Dropdown[By],[_THISROW].[Ax]=[A])


This is a litle bit wrong. [_THISROW] will take values from your current table (Source), so and SELECT() is inside Dropdown, so...:

Select(
  Dropdown[By],
  [_THISROW].[A]=[Ax]
)

@Romulo88 wrote:

Under Autocompute/Suggested Values: SPLIT(LOOKUP([_THISROW].[Column "B"], "Dropdown", "By", "Cz"),";")


Inside AppFormula:

Select(
  Dropdown[Cy],
  IN(
    [Bx],
    [_THISROW].[B]
  )
)
IN() - AppSheet Help 


@SkrOYC wrote:

Select( Dropdown[Cy], IN( [Bx], [_THISROW].[B] ) )


Sorry, I messed the column names:

Select(
  Dropdown[Cz],
  IN(
    [By],
    [_THISROW].[B]
  )
)

Hi, thank you very much for your quick response. I implemented this latest code under App Formula and it worked. What is now a bit unclear is and I am looking for Appsheet Best Practices ๐Ÿ˜ƒ

When to generate a dropdown with Text and when with Enumlist? If Enumlist is selected, when Base Type List and when Base Type Text?

My Column "A" is a dropdown in which the user can only select a single Value. The Column "B" is a multiselect field.

 

Thanks in advance!


@Romulo88 wrote:

My Column "A" is a dropdown in which the user can only select a single Value


Enum Basetype Text. Use your list expression inside the Valid_if to prevent users from adding more options.


@Romulo88 wrote:

The Column "B" is a multiselect field


EnumList BaseType Text