Skip to main content
Solved

Adding an attribute to varying datasets

  • September 25, 2023
  • 2 replies
  • 23 views

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

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

hkingsbury
Celebrity
Forum|alt.badge.img+63
  • Celebrity
  • 1625 replies
  • 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
  • 1 reply
  • September 27, 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

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