How can I use MultipleExpressionResolveResults or use more than one field in an expression in a custom Experience Builder widget?

04-26-2023 02:40 PM
New Contributor III


I am trying to build a widget that will use two or more fields from a single data source. 

I've cloned the use-expression widget from Esri's Github

Here's the issue I'm running into.  When I try to use two fields in the expression, I get an Invalid Expression error:


If I could solve this error and use more than one field in the Expression builder, I could parse it out in the Widget.tsx file.  However, that isn't working for me so I've been trying another approach.

In the API reference, there appears to be a MultipleExpressionResolveResults object.

This appears to be related to the ExpressionResolverComponent.

However, in this solution, I cannot combine the individual expressions into an IMExpressionMap to pass into the ExpressionResolverComponent.  

Any help and/or examples of using multiple expressions/fields in a widget would be much appreciated.  I can provide my code or snippets on request.  Thanks!

0 Kudos
1 Reply
Esri Contributor

Hi @JohnPhillipsGeo , 

For different parts of the expressions, you need to use the "+" to combine the results into one string, something like. 



0 Kudos