Virtual Column -IF

Hi, I have a doubt about a formula. I try to create a schema of status for Skid or Trucks, depending on the type is a status. example:

if Type storage is Skid the status must say “Material in Storage”
If Type Storage is Truck status must say " Truck in the Yard"
etc etc the formula is this

image

but when add a register and the first condition is complete don’t show in row Status


image
the status shows correctly
image

but when save …apparently, all is ok but a few seconds the status disappear

image

image
I check my formule a don’t know why take a last criterion " "
image
image
image

Perhaps you have a data change action that’s resetting it?

I suppose but the stranger is this app just started to develop. and not have any data or actions

Hi @daniel_sanchez
Do you have a conflict with “initial value expression” vs “app formula” ?
You should have only one, but not both fields completed.

1 Like

Instead of using so many if condition you can use ifs here

For example ifs ([storage type] =“1” ,[STAUTS]=“1”,
[storage type] =“2” ,[STAUTS]=“1”)

Try in this format

1 Like

Is a virtual Colum, is not supposed to have Initial value expression?

You are correct, I was assuming you were calculating a real column.

So, that means one of the input for your calculation is evolving when syncing.
I suggest you have a look to the expressions of each column input, such as [Tipo de Almacenaje] , [Fecha de Envio], and so on.

Typically, with virtual column you have (it is probably not accurate but that the behavior I see from my experience) :

  • immediate calculation
  • writing down values on your database
  • syncing back the values written
  • actualize virtual columns values, depending on your database actual values

So, maybe one of your form values is not being written properly. Can you check these ?

About the last criterion: if you write “TEST”, the “TEST” remains ?

“About the last criterion: if you write “TEST”, the “TEST” remains ?”

yes, so this confirm that the formula works but no criteria is valid

Change the formula for ifs and happen same…
simplify the formula so that it only shows the first two statuses

if for example makes the entry “Cajas de Zinc” the status shows the correct legend…


image

but is change to “Material en Bodega”


image

I have changed the original legend called “Material en Bodega” to “Almacenado en Bodega” and it worked !!

image

I still don’t understand what happened :sweat_smile: :sweat_smile:

2 Likes