Skip to main content
Question

Add value to attribute


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.

 

 

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+21
  • 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+44
  • 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.

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