Skip to main content
Question

Attribute name from attribute value

  • June 14, 2014
  • 4 replies
  • 373 views

Hi,

 

 

This subject is discussed already quite some times but I don't get it working.

 

I have a loop where a feature enters with 3 fields (field_name, field_value).

 

I want to use the AttributeCreator to make a field that is named after the value in "field_name" and gets the attribute value from "field_value".

 

As there is an option inside the AttributeCreator "Attribute Name from Attribute Value" is supposed this would do the trick. But this does not create a new attribute. If I type the actual field name in the "Attribute Name" field in the transformer it just works fine.

 

 

The attribute names are like this:

 

net_elements{0}.xlink_href

 

net_elements{1}.xlink_href

 

net_elements{2}.xlink_href

 

net_elements{3}.xlink_href

 

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

4 replies

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • June 16, 2014
Are you referring to @Value(@Value(att_name) ?

  • Author
  • June 16, 2014
For some reason the new attribute doesn't show up in the table view of my data inspector but only in the feature information window.

 

So actually it is working perfect.

takashi
Celebrity
  • June 16, 2014
Hi,

 

 

The attributes which have not been exposed in the workspace will not appear in the Table View. This is the reason. It's the same situation as unexposed format attributes, e.g. "fme_dataset".

 

If you need to display them in the Table View, consider using the AttributeExposer to expose them.

 

 

Takashi

helmoetz
Supporter
Forum|alt.badge.img+15
  • Supporter
  • July 11, 2024

In summary:

You can use an AttributeManager to create an Output Attribute @Value(“field_name") with Attribute Value @Value("field_value”). Like takashi says, you have to expose the new attribute, unless you work with a dynamic schema in which case FME will recognize the created attribute as the same as defined in the schema.