Skip to main content
Solved

Mapping a source filename as attribute value

  • December 20, 2016
  • 4 replies
  • 432 views

Forum|alt.badge.img

Is there a way to have schemamapper read the name of a source table (shapefile), and populate a target attribute field with that name in the writer? Please see the attachment for illustration of question/goal.

Best answer by erik_jan

For each feature in the Shape files the name of the file is stored in the format attribute fme_feature_type. That attribute can be exposed in the settings of the reader feature type or by using the AttributeExposer transformer.

The value can be copied into the attribute dataSource using an AttributeManager, AttributeCopier or similar transformer.

I do not think you need a SchemaMapper transfomre for this.

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

4 replies

erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • Best Answer
  • December 21, 2016

For each feature in the Shape files the name of the file is stored in the format attribute fme_feature_type. That attribute can be exposed in the settings of the reader feature type or by using the AttributeExposer transformer.

The value can be copied into the attribute dataSource using an AttributeManager, AttributeCopier or similar transformer.

I do not think you need a SchemaMapper transfomre for this.


Forum|alt.badge.img
erik_jan wrote:

For each feature in the Shape files the name of the file is stored in the format attribute fme_feature_type. That attribute can be exposed in the settings of the reader feature type or by using the AttributeExposer transformer.

The value can be copied into the attribute dataSource using an AttributeManager, AttributeCopier or similar transformer.

I do not think you need a SchemaMapper transfomre for this.

 

Thank you for your answer. For order of operations, can I run my SchemaMapper process first and then run the workflow you described without overwriting my first operation? Sorry if I sound like a noob, but I am.

erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • December 21, 2016
daveyourguide wrote:

 

Thank you for your answer. For order of operations, can I run my SchemaMapper process first and then run the workflow you described without overwriting my first operation? Sorry if I sound like a noob, but I am.
Yes, you can. The fme_feature_type attribute is available on every data source.

 

 


Forum|alt.badge.img

Ok, I took a stab at it based on your answer - please see screencap. The results as you can see indicate that the process ran but no attribution resulted. Also, what is the parameter to ensure records are not overwritten from the first process. Thanks for your help.attexposerattmgr.png


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