Skip to main content
Solved

Mapping a source filename as attribute value

  • December 20, 2016
  • 4 replies
  • 506 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.

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.

4 replies

erik_jan
Contributor
Forum|alt.badge.img+23
  • 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

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+23
  • Contributor
  • December 21, 2016

 

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