Skip to main content
Best Answer

Renaming attribute from list with _element_index

  • June 18, 2019
  • 2 replies
  • 68 views

I have a list which I exploded using the listExploder. The output contains an attribute _element_index. I want to create an attribute with a name composed of the value of _element_index concatenated with another string. When I try to write the name of this new attribute in an AttributeCreator, it seems like the @Value(_element_index) doesn't work as no new attribute is created (the new attribute name doesn't appear as an option in the AttributeExposer).

Best answer by ebygomm

The new attribute name(s) won't be an option in the AttributeExposer, you will have to manually type it/them in. You can check whether the attribute has actually been created in the Feature Information on the right hand side which will show unexposed attributes

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.

2 replies

ebygomm
Influencer
Forum|alt.badge.img+46
  • Influencer
  • Best Answer
  • June 18, 2019

The new attribute name(s) won't be an option in the AttributeExposer, you will have to manually type it/them in. You can check whether the attribute has actually been created in the Feature Information on the right hand side which will show unexposed attributes


Forum|alt.badge.img+2

@nademmy AttributeCreator has an menu item under the New Attribute column to select the value of an attribute as the attribute name.

You can actually just type it in as @Value(newAttrName). In the attached example workspace (2019) I've used one AttributeCreator to to create a temporay attribute 'newAttrName' that is a concatenation of '_element_index' & 'attr'. then @Value(newAttrName) returns the value of that attribute as the New Attribute name. You won't see these new attributes in workbench since they are only generated at run time, but you'll see them in Data Inspector, i.e.:

3_myvalue othervalue

Here's the example workspace: createattributename.fmw