List Dereferences Key Value, not instantly show the label

Hi There,
I have three table, lets say TableA, TableB, and Table Tags

Both Table A and B have a column type Enumlist (Base type Ref to Table Tags) named [TableA_Tags] and [TableB_Tags].

Table B have a [Ref Column] type enumlist (not mandatory column) of Table A.

My initial Value of [TableB_Tags] is: IF(ISNOTBLANK[Ref Column], [Ref Column][TableA_Tags], List(β€œβ€))

In the form view if the initial value of [TableB_Tags] have only one value, the value shown normally as the Label Column of Table Tags, but if the initial value have more than one value, it shown as a single value (Ex:β€œc1471f09, 3e07aff3”), not two value of β€œc1471f09”, and β€œ3e07aff3” so of course the label of Table Tags is not shown.

If I save it as is, and then wait for a while the system will correct it accordingly.

My question is, is there a way to instantly shows the label (still in form view) no matter how many initial value computed?

[Tags] Column setting in each table A and B:

Initial Value of [TableB_Tags] in form view:

Rome18_1-1659710768831.png

Please post screenshots of the involved expressions. The expressions you included above are invalid.

2 Likes

Sorry, my expression is like this.

This is the form view before saving.

this is the result after saving it and waiting for a while

You mentioned that you put this as initial value. From my experience, Initial Value only works when a form is access to add new records.

If the record is exsiting, I never experienced the Initial Value kicking in when something changes in other tables.

Will that Tags column will always get value from the other table? Orr do you also allow users typre in/select their own tags?

1 Like

If the other table have that Tags, the initial value is that Table Tags and allow users to adjust it.

And yes, this is for adding a new records on Table B with the value of column Tags in Table A so the problem is only shows in form view

1 Like

I see.

I’m just guessing that, based on your screenshot, appsheet sees the initial value as invalid until the app detected the tags being added.

Can you try also putting the initial value expression in the EnumList’s valid_if? See if it forces the Enum List to recognize it as valid at the onset.

I did add the valid if expressions, but it does not recognize the value. Because the initial value generate single value no matter how many value it should’ve compute, like this: β€œc1471f09, 3e07aff3,3jskf9le”. So the form cannot be saved if I add valid if expression

1 Like

Can you please try an initial value expression of

IF(ISNOTBLANK[Ref Column], [Ref Column].[TableA_Tags],LIST( β€œβ€))

Or please try below , based on your mentioned expression

IF(ISNOTBLANK[Ref Column], [Ref Column][TableA_Tags],LIST( β€œβ€))

1 Like

The Expression with [Ref Column].[TableA_Tags] works if my [Ref Column] Type is enum, the problem is that my [Ref Column] Type is Enumlist so I need the list dereferences the column. the List dereferences technically works, but before I saved the form it shows the value as a single value.

What I want is list dereferences value to instantly shows (in form view) as the label value

Please try this expression. Please wrap β€œβ€ with LIST() as LIST(β€œβ€) as suggested.

1 Like

I did

May we know the result? Is it same as before?

2 Likes

This is the result, the dereference value is corrected after the form is saved, not before. so it is a little bit weird for the user to see some key value with exclamation mark.

Oh okay.

My testing had shown that in the expression

IF(ISNOTBLANK[Ref Column], [Ref Column][TableA_Tags], β€œβ€) , one result ( [Ref Column][TableA_Tags]) of IF() is a list , whereas the second alternate result (β€œβ€) is a text value. So expression shows errors in evaluation as below.

You may want to try with the below expression. I believe if Table B is child table of table A, then it is the right syntax.

IF(ISNOTBLANK[Ref Column], [Ref Column].[TableA_Tags],LIST( β€œβ€))

It works in my test app and shows labels instead of keys.

[ Products] is enumlist column in child table as shown below.

[ProductsP] is the enulmlist column in the parent table as shown below.

If it still does not work, then I am sorry that I have no more suggestions. maybe I am unable to create an exact test condition as yours.

1 Like

Thank you for testing it personally

Before we going further, I think I need to clarify my question.

  1. Yes, the formula for my initial value have the LIST(β€œβ€) already. I already edit my initial formula in my post (My bad :grin: ).

  2. My question is not about the expression but about the result value. The formula computed correctly and give the right value which is: c1471f09 (Have Label of Purchase Order #00001), and 3e07aff3 (Have Label of Purchase Order #00002). But in the form view, this value is considered as single value which is β€œc1471f09, 3e07aff3”. So of course the Label doesn’t show up , and the value have exclamation mark on it. Later if I save the form and wait for a while, Appsheet will correct the value into Two Value of β€œc1471f09”, and β€œ3e07aff3” after this the label work because Appsheet already know its a key value. So, why Appsheet does not know if Value β€œc1471f09, 3e07aff3” are Two Value in form view? I already set the list separator as β€œ,”.

Hi @Rome18 ,

Thank you for all the details. I think I have understood your problem.

Could you please try the suggested expression with a dot(.) between [Ref Column] and [TableA_Tags]

[TableA_Tags] that is [Ref Column].[TableA_Tags]

1 Like

Yes, tried that already.

If my understanding is correct. I think β€œ.” is for enum base type ref not for enumlist. So I got the error like this.

and this is the column setting of my [PurchaseInvoice_Receiving_ID]

If I change the column type to enum, the formula with β€œ.” is valid.

Oh okay, now I got it. Thank you. My test was always with first column ( equivalent of ) [PurchaseInvoice_Receiving_ID] ) with one value not an enumlist. So do you mean both [PurchaseInvoice_Receiving_ID] and [Receiving_Tags] are enumlists?

1 Like

Yes, that is correct. My ref column is also type enumlist.

May we know the type of [Receiving_Tags] column? Is it also enumlist?

1 Like