i have some difficulties with an expression o...

expressions
(Valiant Beekes) #1

i have some difficulties with an expression on appsheet: IF({[PRODUCT]=“539-10”},{CONCATENATE([MACHINE],"-",YEAR([DATUM]),"-",UNIQUEID())},{[MACHINE].[BATCH]})

it keeps giving the error: LIST has elements of mismatched types while the types of the columns are text.

is there someone with a solution?

Cheers, Valiant

(Levent KULAÇOĞLU) #2

@Valiant_Beekes why do you need the curly brackets in your expression? And where do you place this expression?

(Valiant Beekes) #3

@Levent_KULACOGLU i assumed that it would me neccecery because there are multiple different elements in the expressions. the expression will be used in a form. if the product is 539-10 > a new batchnumber will be generated. else> the current batchnumber will be imported via the machine tab.

(Valiant Beekes) #4

i just tried in Initial value. then the BATCH entry is visible. but the formula does not work (no initial values)

(Valiant Beekes) #5

@Levent_KULACOGLU i’ve tried the new one. sadly does not work either.

(Levent KULAÇOĞLU) #6

@Valiant_Beekes it’s hard to say more without seeing your app and your gSheet structure

(Levent KULAÇOĞLU) #7

May be @Aleksi_Alkio might say more on this

(Valiant Beekes) #8

@Levent_KULACOGLU thank you for the support. hopefully Aleksi Alkio can help me further

(Aleksi Alkio) #9

What happens if you try just [MACHINE].[BATCH] as an initial value?

(Mary Jane Pender) #10

@Valiant_Beekes

Hi Val, you show curly brace brackets in your formula {

} .

Are you actually using these brace brackets?

(Levent KULAÇOĞLU) #11

@Valiant_Beekes

IFS( [PRODUCT]=“539-10”,CONCATENATE([MACHINE],"-",YEAR([DATUM]),"-",UNIQUEID()) TRUE,[MACHINE].[BATCH] ) expression should do the trick

(Valiant Beekes) #12

@Levent_KULACOGLU thanks for your input! unfortunately the trick does not work… i get the error: IFS function is used incorrectly:Inputs to IFS() must be one or more condition-value pairs.

(Levent KULAÇOĞLU) #13

@Valiant_Beekes

Do apologize, forgot a comma ::blush: Now try it please…

IFS( [PRODUCT]=“539-10”,CONCATENATE([MACHINE],"-",YEAR([DATUM]),"-",UNIQUEID()), TRUE,[MACHINE].[BATCH] )

(Valiant Beekes) #14

@Levent_KULACOGLU hi! thanks the expression! the error is gone. but the expression does not fill the cell and is not visible in the form… im sorry for the troubles

(Valiant Beekes) #15

@Levent_KULACOGLU when i test the expression in the expression builder. the result is always “-”

(Levent KULAÇOĞLU) #16

@Valiant_Beekes can you tell me where explicitly you are trying to construct this expression? Initial value? AppFormula?

(Valiant Beekes) #17

@Levent_KULACOGLU App Formula

(Levent KULAÇOĞLU) #18

@Valiant_Beekes

Can you try this one?

IFS( [_THISROW].[PRODUCT]=“539-10”,CONCATENATE([_THISROW].[MACHINE],"-",YEAR([_THISROW].[DATUM]),"-",UNIQUEID()), TRUE,[MACHINE].[BATCH] )