Skip to main content
Question

Dynamic boolean expression - ExpressionEvaluator ?

  • March 6, 2026
  • 3 replies
  • 21 views

lifalin2016
Supporter
Forum|alt.badge.img+40

Hi.

This may be a simple or a complex question, I’m not sure which.

I’m attempting to use a dynamic expression, that I construct dynamically from values read from a file or table, and evaluate it on all relevant feature read from a database or file. Including AND/OR etc.

How can this be achieved in Workbench ?

I’ve tried to utilize ExpressionEvaluator with the expression @Value(@Value(expr)), but it doesn’t return any value in the “_result” variable.

What am I doing wrong, and is it even feasable ?

Are there better ways to achieve this ?

Using 2025.2.4

Cheers

3 replies

lifalin2016
Supporter
Forum|alt.badge.img+40
  • Author
  • Supporter
  • March 6, 2026

Addendum.

I got a heureka moment, when I found the trinary “?:” operator.
I.e. conditionValue ? trueValue : falseValue

But alas, it didn’t make a difference :-(

ExpressionEvaluator just returns either the expression un-evaluated, or return a missing value.

I’ve tried to encapsulate the whole expression in @Value() and @Evaluate(), but neither works.

Here’s a sample value of the expression:

How to I force FME to evaluate my expression ?


ebygomm
Influencer
Forum|alt.badge.img+46
  • Influencer
  • March 6, 2026

I don’t think you can use the ExpressionEvaluator to compare strings which is where the issue is.

It works if you supply an expression in an attribute that is doing a numeric test

Is there a particular reason to use the ExpressionEvaluator?

Could you build an expression like this instead?

I’m not sure what exactly you’re looking to achieve but there are probably better ways


lifalin2016
Supporter
Forum|alt.badge.img+40
  • Author
  • Supporter
  • March 6, 2026

I don’t think you can use the ExpressionEvaluator to compare strings which is where the issue is.

Is there a particular reason to use the ExpressionEvaluator?

Thanks ​@ebygomm 

I’ve never used ExpressionEvaluator before, just expressions in AttributeManager. But I really thought this transformer would be more versatile than it apparently is, judging just from its name.

No, I don’t need to use this transformer, I’m searching for a general way to evaluate dynamic expressions, as I have a multitude of different expressions which can be quite complex.

I’m now instead looking into the Python eval(), and it looks very promising.

However, I still would’ve liked a native FME solution to this problem.