String comparison in generated column

In my table I want to define a generated column of type boolean, which indicated the equality of two strings.
The first string is in the field ownerId of this table. The second string is the field ownerId of a table to which I have defined a 1:1 data relation.

I’m trying expressions like this:

  WHEN ownerId = recipeRelation.ownerId  
    THEN true
  WHEN ownerId <> recipeRelation.ownerId   
    THEN false

This always evaluates to TRUE although I have case where ownerId <> recipeRelation.ownerId.

Any way to achieve this?


Have you inspected the record where you get true while you expect false? Are the ownerId and recipeRelation.ownerId values indeed different?

Hi @mark-piller ,
They are indeed different!
Please check App ID: 5BDF0E64-9F03-6F8E-FF75-0E183AF61100
Table: CollectionRecipes

I am looking into it, @Klaas_Klever . Here’s an observation that explains the behavior. I created a column that displays both ownerId and the related ownerId and here’s what I see:

Unfortunately, I could not find a solution. Looks like something is not quite right with the relation value. I also noticed that non-system columns in the related table are not available in the generated column. Have you tried a workaround using a View?

Hi @mark-piller ,
The view wil be my next step. I will add the relation field to the view. There is no way to have computed fields in a view right? If not, I will use a query in my server code to compare the two ownerId fields.

I’ll let you know …