Solved

How do I create an alias on an attribute in my FME workspace?

  • 3 March 2016
  • 9 replies
  • 144 views

Badge

I need to create an alias on a couple attributes in my workspace. They do not have aliases when they are read in but they need to have them when they are written to a different layer. I am reading and writing into a Esri Geodatabase (ArcSDE Geodb). I am pretty sure I can do this with the AttributeManager but am unsure how.

icon

Best answer by mark2atsafe 4 March 2016, 17:49

View original

9 replies

Userlevel 2
Badge +16

I think it is explained in this document:

https://knowledge.safe.com/content/kbentry/22423/working-with-geodatabase-field-aliases.html

Badge

That only works if the attribute has an alias when it is read in. It will not work to create a new alias. I already read that article and tried it out it did not work. I need to create an alias where none exist.

Userlevel 2
Badge +16

That only works if the attribute has an alias when it is read in. It will not work to create a new alias. I already read that article and tried it out it did not work. I need to create an alias where none exist.

From the Feature representation section of the SDE writer I copied this:

<attribute-name>_aliasWhen reading, if ALIAS_MODE is set to ON_DATA_FEATURES, then a secondary attribute that contains the attribute alias will be added to each feature, for each attribute.

When writing, these attributes will be respected when creating feature classes or tables.

So creating an attribute test_alias with value "testalias" is supposed to create an alias for the test attribute with the value testalias.

If that does not work I would send a call to support@safe.com

Badge

From the Feature representation section of the SDE writer I copied this:

<attribute-name>_aliasWhen reading, if ALIAS_MODE is set to ON_DATA_FEATURES, then a secondary attribute that contains the attribute alias will be added to each feature, for each attribute.

When writing, these attributes will be respected when creating feature classes or tables.

So creating an attribute test_alias with value "testalias" is supposed to create an alias for the test attribute with the value testalias.

If that does not work I would send a call to support@safe.com

That does work. But it only creates <attribute-name>_alias if there is an alias. If there is not one then nothing happens and there is nothing to edit in the attributemanager. My attribute do not have aliases when read in.

Badge +22

You need to create the alias as a new attribute.

Depending on how many there are, you can either manually add them in the AttributeManager, or use a joiner to reference an external file (eg csv) that contains the values.

Badge

You need to create the alias as a new attribute.

Depending on how many there are, you can either manually add them in the AttributeManager, or use a joiner to reference an external file (eg csv) that contains the values.

When I use the attributemanager to add <attribute-name>_alias with the alias as the attribute value it just creates a new attribute with value of the alias for every object. I am looking for what the setting in attributemanager are that will make the attribute an alias with out it already exsisting.

Userlevel 4
Badge +25

The developers tell me:

The answer is Yes. We will create attribute aliases if there is an additional attribute with the same name as the original attribute but suffixed with '_alias', then the value of that attribute will be used as the alias on table creation. For example if my attribute's name is mytext and there is also a mytext_alias with value alias of mytext, then the value of mytext_alias will be used as the attribute's alias. It need only be on the first feature.

Hopefully that works for you. There is no need to have aliases on the incoming data. If you still can't get it to work, submit a case to our support team (safe.com/support)

Userlevel 4
Badge +25

The developers tell me:

The answer is Yes. We will create attribute aliases if there is an additional attribute with the same name as the original attribute but suffixed with '_alias', then the value of that attribute will be used as the alias on table creation. For example if my attribute's name is mytext and there is also a mytext_alias with value alias of mytext, then the value of mytext_alias will be used as the attribute's alias. It need only be on the first feature.

Hopefully that works for you. There is no need to have aliases on the incoming data. If you still can't get it to work, submit a case to our support team (safe.com/support)

Oh, one more caveat: if the alias attribute is exposed as a User attribute in the writer feature type, then it will be treated like a regular attribute. So don't add it to the Writer feature type

Badge +22

When I use the attributemanager to add <attribute-name>_alias with the alias as the attribute value it just creates a new attribute with value of the alias for every object. I am looking for what the setting in attributemanager are that will make the attribute an alias with out it already exsisting.

That's what you need to do. As long as you don't include the x_alias on the writer feature type, fme should pick it up as an alias

Reply