Skip to main content
Solved

In 2016 How can I rename individual elements of a list?

  • February 5, 2016
  • 10 replies
  • 47 views

jdh
Contributor
Forum|alt.badge.img+40

I often use the AttributeSplitter or other transformers to parse data and rename the resulting list elements as regular attributes.

 

In FME 2015, an AttributeRenamer could point to a specific list element (ie _list{1}) to rename it, this is no longer the case in FME2016.

 

 

Example

 

_list{0}: 45

 

_list{1}: 30

 

_list{2}: 31

 

 

would be renamed to

Degrees: 45

 

Minutes: 30

 

Seconds: 31

Best answer by takashi

The AttributeRenamer still works to rename individual list elements. You can edit the "Input Attribute" column directly. e.g. change "_list{}" to "_list{0}".

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.

10 replies

erik_jan
Contributor
Forum|alt.badge.img+23
  • Contributor
  • February 5, 2016

AttributeManager is the transformer to do this.


jdh
Contributor
Forum|alt.badge.img+40
  • Author
  • Contributor
  • February 5, 2016

AttributeManager is the transformer to do this.

How?

 

The attributeManager allows me to rename the list, but I can't figure out how to rename the elements.

 


erik_jan
Contributor
Forum|alt.badge.img+23
  • Contributor
  • February 5, 2016

See attached images:


takashi
Celebrity
  • Best Answer
  • February 5, 2016

The AttributeRenamer still works to rename individual list elements. You can edit the "Input Attribute" column directly. e.g. change "_list{}" to "_list{0}".


takashi
Celebrity
  • February 6, 2016

The AttributeRenamer still works to rename individual list elements. You can edit the "Input Attribute" column directly. e.g. change "_list{}" to "_list{0}".

I updated an Idea concerning to setting list elements to the Input Attribute column of the AttributeRenamer: Allow Selecting Multiple List Elements for Old (Input) Attribute Column in AttributeRenamer


fmelizard
Safer
Forum|alt.badge.img+21
  • Safer
  • February 6, 2016

I updated an Idea concerning to setting list elements to the Input Attribute column of the AttributeRenamer: Allow Selecting Multiple List Elements for Old (Input) Attribute Column in AttributeRenamer

We'll dig into this. Sorry @jdh for the complication here. We'll see what we can do in 2016.1


jdh
Contributor
Forum|alt.badge.img+40
  • Author
  • Contributor
  • February 8, 2016

See attached images:

This creates a second set of attributes rather than renaming the list, which admittedly can be removed once all the attributes have been copied, but is not the most efficient when dealing with large datasets.


erik_jan
Contributor
Forum|alt.badge.img+23
  • Contributor
  • February 8, 2016

In the same AttributeManager after copying the wanted attributes, you can remove the list. You do not need a second transformer to do that.


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • February 8, 2016

The best answer is actualy not true. And has never been.

The list will not be renamed.

You will be creating a new attribute from the listelement. The selected list attribute is removed from the list.

Check the data inspector, you will see the list is now without the selected element.

The selected element has become an attribute.

U end up with an unbalanced list...appearantly?


jdh
Contributor
Forum|alt.badge.img+40
  • Author
  • Contributor
  • February 8, 2016

The best answer is actualy not true. And has never been.

The list will not be renamed.

You will be creating a new attribute from the listelement. The selected list attribute is removed from the list.

Check the data inspector, you will see the list is now without the selected element.

The selected element has become an attribute.

U end up with an unbalanced list...appearantly?

In this scenario, that's actually the goal. I want to turn the list into a set of independent attributes.