Solved

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

  • 23 August 2021
  • 2 replies
  • 24 views

Badge +1

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?

icon

Best answer by virtualcitymatt 24 August 2021, 13:10

View original

2 replies

Userlevel 4
Badge +26

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.

​​

Badge +1

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.  

Reply