Skip to main content
Solved

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


plynn
Participant
Forum|alt.badge.img+3
  • Participant

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.

​​

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

2 replies

virtualcitymatt
Celebrity
Forum|alt.badge.img+39
  • Celebrity
  • 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
Participant
Forum|alt.badge.img+3
  • Author
  • Participant
  • August 24, 2021
virtualcitymatt wrote:

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.  


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