Wednesday, January 9, 2019

Saved Search > Using Formula Expression CONCAT to Join 2 Fields and Character "&" in Between Gives Error Invalid Expression

When users use CONCAT to join multiple fields, the expression as below is used:


Concat({fieldidAAA}, concat(concat(' ', {fieldidBBB}), concat(' ', {fieldidCCC})))


However, when the said expression is used to join a character, it gives an Invalid Expression.

 

Sample formula that shows this problem:

Concat({fieldidAAA}, concat(concat(' ', '&'}), concat(' ', {fieldidBBB})))

 

To resolve, instead of using CONCAT, use double pipe (||).

 

Steps:

1. Edit a saved search.

2. Under Results tab add Formula (Text) field with this value:

Formula =  {fieldidAAA} || '&' || {fieldidBBB}

3. Preview or Save & Run.

Actual Result: FIELDAAA & FIELDBBB

No comments:

Post a Comment