Skip to main content
Solved

How to automatically update the attributes when a different file is selected in my Reader.

  • August 23, 2021
  • 2 replies
  • 178 views

plynn
Contributor
Forum|alt.badge.img+10
  • Contributor
  • 9 replies

I have an Excel Reader and several transformers that follow. I would like the attributes to update when I select a new .xlsx file. Most attributes should be the same but on occasion a file is submitted with one of the column names a little bit different. I was hoping that I would just have to re-connect those. What I have been experiencing is that I have to Update the Reader and then my AttributeManager transformers have to be completely rebuilt.

 

Example:

First Run - Fieldnames are CITY, STATE, ZIP

Second Run - Fieldnames are MY CITY, STATE, ZIPCODE

 

Is there an easy way to handle this?

Best answer by virtualcitymatt

This is how it works unfortunately. The Schema is pretty important in FME. You can look into dynamic workflows but that is mostly when you don't know/care what the schema is, you just want to preserve it.

Perhaps what might be useful in your case is to instead read the data based on the position of the data rather than the column names.

You can rename column 'A', 'B', etc to be what you like. In this case the input attributes will always have the same names and you won't need to update the attribute manager.

You will need to remove the header row though. ​

This method assumes that you will always have the same columns in the same position just sometimes with different names.

​​

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.

2 replies

virtualcitymatt
Celebrity
Forum|alt.badge.img+47
  • Celebrity
  • 2000 replies
  • Best Answer
  • August 24, 2021

This is how it works unfortunately. The Schema is pretty important in FME. You can look into dynamic workflows but that is mostly when you don't know/care what the schema is, you just want to preserve it.

Perhaps what might be useful in your case is to instead read the data based on the position of the data rather than the column names.

You can rename column 'A', 'B', etc to be what you like. In this case the input attributes will always have the same names and you won't need to update the attribute manager.

You will need to remove the header row though. ​

This method assumes that you will always have the same columns in the same position just sometimes with different names.

​​


plynn
Contributor
Forum|alt.badge.img+10
  • Author
  • Contributor
  • 9 replies
  • August 24, 2021

This is how it works unfortunately. The Schema is pretty important in FME. You can look into dynamic workflows but that is mostly when you don't know/care what the schema is, you just want to preserve it.

Perhaps what might be useful in your case is to instead read the data based on the position of the data rather than the column names.

You can rename column 'A', 'B', etc to be what you like. In this case the input attributes will always have the same names and you won't need to update the attribute manager.

You will need to remove the header row though. ​

This method assumes that you will always have the same columns in the same position just sometimes with different names.

​​

Thanks @virtualcitymatt​ for the info.