Skip to main content
Solved

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


mbaer
Contributor
Forum|alt.badge.img+1
  • Contributor

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.

Best answer by mark2atsafe

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)

View original
Did this help you find an answer to your question?

9 replies

erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • March 3, 2016

mbaer
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • March 3, 2016
erik_jan wrote:

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.


erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • March 3, 2016
mbaer wrote:

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


mbaer
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • March 3, 2016
erik_jan wrote:

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.


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • March 4, 2016

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.


mbaer
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • March 4, 2016
jdh wrote:

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.


mark2atsafe
Safer
Forum|alt.badge.img+44
  • Safer
  • Best Answer
  • March 4, 2016

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)


mark2atsafe
Safer
Forum|alt.badge.img+44
mark2atsafe wrote:

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


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • March 4, 2016
mbaer wrote:

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings