Solved

Renaming attribute from list with _element_index

  • 18 June 2019
  • 2 replies
  • 10 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).

icon

Best answer by ebygomm 18 June 2019, 15:53

View original

2 replies

Userlevel 1
Badge +10

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

Badge +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

Reply