Skip to main content
Solved

Use functions in SchemaMapper

  • February 27, 2025
  • 2 replies
  • 32 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.

View original
Did this help you find an answer to your question?

2 replies

debbiatsafe
Safer
Forum|alt.badge.img+20
  • 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

@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.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings