Skip to main content
Solved

Use functions in SchemaMapper

  • February 27, 2025
  • 2 replies
  • 72 views

arnovananrooij
Contributor
Forum|alt.badge.img+5

Hi,

I would like to use a simple function in the SchemaMapper for Attribute value for a new attribute. In an AttributeCreator I would use @Value(Lat)#@Value(Lng). This concatenates two values seperated by a #. I can't get it to work in a SchemaMapper. I tried @EvaluateExpression(@Value(Lat)#@Value(Lng)), but the SchemaMapper interprets this as a string and not a function. How can I make this work?

Btw, I use FME 2023.2.5.

Thank you, Arno

Best answer by debbiatsafe

Hello ​@arnovananrooij 

Have you specified fmeexpression= in front of the expression concatenating the two values? For example, the CSV for the SchemaMapper should look like this:

TargetAttribute|TargetValue
latlong|fmeexpression=@Value(lat)#@Value(long)

This should create a new attribute named latlong which concatenates the value of lat and long separated with #. You may need to expose the new attribute with an AttributeExposer or AttributeManager.

Please note that there is a bug (FMEENGINE-82741) where using fmeexpression= in the SchemaMapper will cause a space to be inserted at the start of target attribute value. This has been fixed in FME 2025.0 betas. 

As you are using 2023.2, please use an AttributeTrimmer after the SchemaMapper to remove the space.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

debbiatsafe
Safer
Forum|alt.badge.img+21
  • Safer
  • Best Answer
  • March 3, 2025

Hello ​@arnovananrooij 

Have you specified fmeexpression= in front of the expression concatenating the two values? For example, the CSV for the SchemaMapper should look like this:

TargetAttribute|TargetValue
latlong|fmeexpression=@Value(lat)#@Value(long)

This should create a new attribute named latlong which concatenates the value of lat and long separated with #. You may need to expose the new attribute with an AttributeExposer or AttributeManager.

Please note that there is a bug (FMEENGINE-82741) where using fmeexpression= in the SchemaMapper will cause a space to be inserted at the start of target attribute value. This has been fixed in FME 2025.0 betas. 

As you are using 2023.2, please use an AttributeTrimmer after the SchemaMapper to remove the space.


arnovananrooij
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • March 4, 2025

@debbiatsafe ,

Thank you very much Debi, I did not know about the fmeexpression=, but it works great. I indeed get an extra space in front of the at the start of the target attribute value. I can fix that later in my workspace.