I’ll try to describe a simplified version of my issue:
In col_b, I have set initial value to either be Apple or Banana.
In col_a, I want it to look at the value of col_b in the same row, if the value of col_b in the same row is Apple, I want to set the value of col_a to Xylophone otherwise set to Yggdrasil if col_b value is Banana.
currently, col_a is an IF statement
IF(IN(“Apple”), [_THISROW].[col_b]), “Xylophone”, Yggdrasil")
(col_b is an enumlist, forgot to mention).
Upon testing, it keeps setting the value of col_a to Yggdrasil even though col_b value is Apple.
I think I described it incorrectly, I actually only need to know if “Apple” is one of the values in of the enumlist in col_b, if that’s true, col_a = “Xylophone” else “Yggdrasil”
The expression you gave will only yield true if col_b value is equal to “Apple”, it won’t be true if the value of col_b is “Apple”, “Carrot”, “Dragonite”.
AppSheet builds dependency trees of expressions, columns, slices, and tables, so if col_a uses/requires col_b, AppSheet will try to resolve col_b before col_a.
Should I expect the same behaviour if the record is added via Appsheet API? I.e. adding the record via API but only have col_c, and col_d as payloads for the record and let the app handle the values for col_a, and col_b?
One additional distinction: dependency resolution determines evaluation order, but it does not make an Initial value continuously reactive. If col_a must always reflect changes to col_b, the expression should normally be placed in col_a’s App formula rather than only its Initial value:
IF(
IN(“Apple”, [col_b]),
“Xylophone”,
“Yggdrasil”
)
For API-created rows, omit the derived columns from the payload and verify the stored row after creation. AppSheet should resolve the dependencies, but explicitly supplied API values may override the calculated defaults.
Also, if col_b is an EnumList with base type Ref, IN() must compare against the stored key values rather than the labels shown in the UI.