Skip to main content
Question

Add value to attribute

  • March 19, 2013
  • 5 replies
  • 814 views

Forum|alt.badge.img
Hi All,

 

Here is simple question;

 

 

How do you assign a value to an existing attribute after the feature passes thru a tester? 

 

 

If the test is true then I want to add a value of "YES" to an existing attribute before it proceeds thru other transformers.  I want to use an existing attribute and not have to create a new attribute and then overwrite the existing attribute.

 

 

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.

5 replies

Forum|alt.badge.img+2
  • March 19, 2013
You need to use an AttributeCreator transformer and link it to the PASSED output port. In the AttributeCreator choose your existing attribute on the left column (AttributeName)and set the value to YES in the right column (Value). There used to be an AttributeSetter in earlier versions but this has been combined into the AttributeCreator from at least FME 2012 onwards.

david_r
Celebrity
  • March 19, 2013
Hi,

 

 

you could also take a look at the StringConcatenator if you want to add "YES" to the end of the existing attribute value. 

 

 

David

davideagle
Contributor
Forum|alt.badge.img+22
  • Contributor
  • March 19, 2013
Hi - after your Tester, just add an AttributeSetter (in FME 2012 onwards this will default to an AttributeCreator). Then pick the attribute you wish to over write from the drop down list and set the "Value" to YES. All features that pass your test will have the value of this attribute set to YES. It's nice and simple...

 

 

Hope that helps.

mark2atsafe
Safer
Forum|alt.badge.img+59
  • Safer
  • March 21, 2013

In FME2013-SP1 (which will be available in 16 hours and 50 minutes) you can do it all in the AttributeCreator. There is a new option for conditional attribute mapping/creating.

 

 

Keep an eye out for an evangelist article I am going to publish tomorrow on the topic. It'll be at: http://evangelism.safe.com/fmeevangelist113/

 

 

Regards

 

 

Mark

Forum|alt.badge.img
  • Author
  • March 21, 2013
Thanks everyone!  All very helpful comments.