Skip to main content
Solved

Adding an attribute to varying datasets


Hello!

 

I am trying to add an attribute to a table from a dataset that is specified by the user. This input data varies in attributes, so I don't know the format of them beforehand. However, I am consistently just adding 1 attribute to this data and writing it to another table. It looks something like this:

image 

The first dataset that I input works fine, but any dataset after that does not match the attributes of the first dataset will not go through properly. I've done some research on dynamic workflows in FME, but I'm still struggling a bit to find a solution to this. Any ideas?

Best answer by hkingsbury

I've attached a simple example that makes use of the schema scanner.

 

I think whats probably causing your issues here is that while you are adding a new attribute (via the attribute manager) you're not actually updating the schema feature (a list on each feature that contains the schema - set by the reader in your case) so when its being passed to the writer, nothing has really changed.

 

Its a bit difficult to give an exact reason why based on the above, as the configuration of the writer is very important in workflows like this

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

2 replies

hkingsbury
Celebrity
Forum|alt.badge.img+55
  • Celebrity
  • Best Answer
  • September 25, 2023

I've attached a simple example that makes use of the schema scanner.

 

I think whats probably causing your issues here is that while you are adding a new attribute (via the attribute manager) you're not actually updating the schema feature (a list on each feature that contains the schema - set by the reader in your case) so when its being passed to the writer, nothing has really changed.

 

Its a bit difficult to give an exact reason why based on the above, as the configuration of the writer is very important in workflows like this


  • Author
  • September 27, 2023
hkingsbury wrote:

I've attached a simple example that makes use of the schema scanner.

 

I think whats probably causing your issues here is that while you are adding a new attribute (via the attribute manager) you're not actually updating the schema feature (a list on each feature that contains the schema - set by the reader in your case) so when its being passed to the writer, nothing has really changed.

 

Its a bit difficult to give an exact reason why based on the above, as the configuration of the writer is very important in workflows like this

This seemed to fix my problem. Using the featureReader and adding an attribute to the schema itself made it work. Thanks for the help!


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