Test view versus editor view show different results

Hi.

Would it be something wrong with my expression so I get different results in the editor than the expected ones from the test view?

Below the first name should not appear in the form list as shown in the test view.

Maybe missing , before TRUE ?

,TRUE

1 Like

Hi @Heru,

Thanks for spotting this! Unfortunately after fixing this one, it still not working in the editor.

FILTER(“Employés”,TRUE)-
SELECT(Affectations[Employé ID],
AND(([_THISROW].[Opération ID]=[Opération ID]),
IN([Statut],{“Acceptée”,“Planifier”,“Publiée”}),
([_THISROW].[Parcours ID]=[Parcours ID]),
([_THISROW].[Employé ID]=[Employé ID])
),
TRUE)

The emulator is displaying the label column value for the corresponding rows in the Employés table. Perhaps the label column doesn’t match the key column?

Hi @Steve,

Subtle! In this case the label column value for the Employés table is the key column Employé ID.
Would it be the only distinction for the emulator?

> Thigh Ugh , Alexy Maurin , Vicky Prévost , Marc-Antoine Turcotte , Christian Bond , Martin Leblanc :: AFFECTATIONS[Employé ID] :: AND(([Affectation ID].[Opération ID] = [Opération ID]), IN([Statut],LIST(“Acceptée”,“Planifier”,“Publiée”)), ([Affectation ID].[Parcours ID] = [Parcours ID]), ([Affectation ID].[Employé ID] = [Employé ID])) :: True Thigh Ugh , Vicky Prévost , Marc-Antoine Turcotte , Christian Bond , Martin Leblanc
Thigh Ugh , Alexy Maurin , Vicky Prévost , Marc-Antoine Turcotte , Christian Bond , Martin Leblanc Thigh Ugh , Alexy Maurin , Vicky Prévost , Marc-Antoine Turcotte , Christian Bond , Martin Leblanc
AFFECTATIONS[Employé ID] :: AND(([Affectation ID].[Opération ID] = [Opération ID]), IN([Statut],LIST(“Acceptée”,“Planifier”,“Publiée”)), ([Affectation ID].[Parcours ID] = [Parcours ID]), ([Affectation ID].[Employé ID] = [Employé ID])) :: True

Alexy Maurin is missing in my copy/paste as the resulting value for the last expression.

I can’t explain the difference in results, but I’m pretty sure there’s no guarantee that FILTER() or SELECT() will produce results in any particular order. I’d propose that if you want the results in a particular order, you’ll have to order them explicitly, perhaps using ORDERBY() or SORT().


Hi @Steve,

The order of the names are not a concern in this topic only the fact the expression seem right according to the test emulator but does work in the app.

Are you saying that this expression needs records to be sorted(or same sequence) to work?

No, that’s just the discrepancy I latched onto when you presented the problem initially. Sorry about that!

Are you using security filters?

I notice too that the Expression Assistant says you’re editing the suggested values expression for the Employé ID column, but the column in the form is Employé. Are those in fact the same column?

Yes.
image

1 Like

I am not using security filters for Affectations, Opérations, Parcours and Employés tables.

1 Like

Okay, next (last?) guess…

There is a quirk with the is-equal operator (and the is-not-equal operator) where if the left-side operand is blank, the expression is TRUE regardless of the right-side value. So, in this expression:

AND(
  ([_THISROW].[Opération ID] = [Opération ID]),
  IN([Statut],{“Acceptée”,“Planifier”,“Publiée”}),
  ([_THISROW].[Parcours ID] = [Parcours ID]),
  ([_THISROW].[Employé ID] = [Employé ID])
)

If [_THISROW].[Opération ID] evaluates to blank, ([_THISROW].[Opération ID] = [Opération ID]) is TRUE.

If [_THISROW].[Parcours ID] evaluates to blank, ([_THISROW].[Parcours ID] = [Parcours ID]) is TRUE.

If [_THISROW].[Employé ID] evaluates to blank, ([_THISROW].[Employé ID] = [Employé ID]) is TRUE.

The IN() function is not affected by this quirk.

It’s possible this quirk only affects the expression tester and not the emulator, or vice versa. Once I discovered the quirk, I decided I needed to assume it affects everything and always code for it.

Could this be the problem?

1 Like

Hi @Steve

This quick seems very annoying! He got me. Thanks!

1 Like