Skip to main content
Solved

retain order and data type of attributes in automatic workflow


marronm
Contributor
Forum|alt.badge.img+4

I’m creating an automatic process to read in data in a feature reader and then output same attributes in the same order that they were read in, to an oracle spatial writer.

I have set up user parameters in the FeatureReader for both the data to be read in and attributes to expose(.csv) however the order of attributes is not retained and neither is the data type. Currently, the attributes are alphabetised and they are all given the same data type of “varchar2”.

Any suggestions on this would be appreciated.

Best answer by danminneyatsaf

marronm wrote:

Thanks for your reply @danminneyatsaf​ , the formats I was reading in feature reader : geojson, file geodatabase, shapefile and CSV. My FME version is 2021.2. I tried using the dynamic workflow with the Generic (Any Format) reader however once one format is in, I couldn't change between formats. For example, I put in my geojson dataset in order to get the generic reader to appear on the workbench but when I tried to run the workbench it wouldn't let me change to an fgdb or shapefile format.

feature readers in different formatsGeneric Reader

@marronm​ The workspace you setup there in your screenshot looks sufficient, does that work for you? My personal preference would be to use multiple FeatureReaders as you have it setup there and allow the user to specify what format they are providing.

You'll need to also connect the Schema output ports from your FeatureReaders to the Dynamic Writer to ensure the features are written out with the appropriate schema. In the Dynamic Writer parameters, you'll need to setup the parameters as in the screenshot below:

image

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

16 replies

danminneyatsaf
Safer
Forum|alt.badge.img+12

Hi @marronm, what format are you reading with your FeatureReader? Additionally, what version of FME are you using?

If you're reading in values and exposing them via a csv file due to schema changes, you can look into using a dynamic workflow where the destination schema is a mirror image of the source dataset since this will preserve the order of the attributes: https://community.safe.com/s/article/dynamic-workflow-tutorial-destination-schema-as-a

 

The issue with the AttributeExposer not retaining the order of the attributes is a known bug with the transformer. We currently have a ticket open regarding this issue (FMEFORM-25548). I've added this question to the ticket so you get notified when the issue is resolved.


marronm
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • December 7, 2023

Thanks for your reply @danminneyatsaf​ , the formats I was reading in feature reader : geojson, file geodatabase, shapefile and CSV. My FME version is 2021.2. I tried using the dynamic workflow with the Generic (Any Format) reader however once one format is in, I couldn't change between formats. For example, I put in my geojson dataset in order to get the generic reader to appear on the workbench but when I tried to run the workbench it wouldn't let me change to an fgdb or shapefile format.

feature readers in different formatsGeneric Reader


danminneyatsaf
Safer
Forum|alt.badge.img+12
  • Safer
  • Best Answer
  • December 11, 2023
marronm wrote:

Thanks for your reply @danminneyatsaf​ , the formats I was reading in feature reader : geojson, file geodatabase, shapefile and CSV. My FME version is 2021.2. I tried using the dynamic workflow with the Generic (Any Format) reader however once one format is in, I couldn't change between formats. For example, I put in my geojson dataset in order to get the generic reader to appear on the workbench but when I tried to run the workbench it wouldn't let me change to an fgdb or shapefile format.

feature readers in different formatsGeneric Reader

@marronm​ The workspace you setup there in your screenshot looks sufficient, does that work for you? My personal preference would be to use multiple FeatureReaders as you have it setup there and allow the user to specify what format they are providing.

You'll need to also connect the Schema output ports from your FeatureReaders to the Dynamic Writer to ensure the features are written out with the appropriate schema. In the Dynamic Writer parameters, you'll need to setup the parameters as in the screenshot below:

image


marronm
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • December 15, 2023

@danminneyatsaf​ Massive progress, thank you very much. The multiple feature readers work with the dynamic writer when I remove the “fme_feature_type_name”. If I leave it in, I get this error:

Cannot define schema for '' as the feature does not contain schema information, and schema source is set to 'Schema from Schema Feature'. Please verify writer feature type configuration

so I have left 'Schema Definition Name' blank.

 

I may be stretching here and this is not a deal breaker for the process but I am wondering is it possible to change the output table name through this FME process? At the moment, it takes the name from the “fme_feature_type”(which is the input file name)

 


danminneyatsaf
Safer
Forum|alt.badge.img+12
marronm wrote:

@danminneyatsaf​ Massive progress, thank you very much. The multiple feature readers work with the dynamic writer when I remove the “fme_feature_type_name”. If I leave it in, I get this error:

Cannot define schema for '' as the feature does not contain schema information, and schema source is set to 'Schema from Schema Feature'. Please verify writer feature type configuration

so I have left 'Schema Definition Name' blank.

 

I may be stretching here and this is not a deal breaker for the process but I am wondering is it possible to change the output table name through this FME process? At the moment, it takes the name from the “fme_feature_type”(which is the input file name)

 

@marronm​ Great to hear that's mostly working for you now.

You can set the output table name to anything you want. You can change the value of fme_feature_type by using an AttributeExposer (to expose fme_feature_type) and then use an AttributeManager to change the value of fme_feature_type. Let me know if that works for you.


marronm
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • December 18, 2023

@danminneyatsaf​ not quite yet - I'm getting that error : Cannot define schema for 'IR_MM' as the feature does not contain schema information, and schema source is set to 'Schema from Schema Feature'. Please verify writer feature type configuration.

As I said this isn't a big issue but I'll go through exactly what I did incase I'm missing something. 'IR_MM' is my user parameter for the output table name. For the Attribute Exposer transformer, I typed in "fme_feature_type" as it wasn't coming up as an option in the drop down. Then for the Attribute Manager, I set the value of fme_feature_type to my user parameter "$(OUTPUT_table_name)" . I didn't make any changes to the dynamic writer this time around, table name remains as "fme_feature_type".attribute manager


danminneyatsaf
Safer
Forum|alt.badge.img+12
marronm wrote:

@danminneyatsaf​ not quite yet - I'm getting that error : Cannot define schema for 'IR_MM' as the feature does not contain schema information, and schema source is set to 'Schema from Schema Feature'. Please verify writer feature type configuration.

As I said this isn't a big issue but I'll go through exactly what I did incase I'm missing something. 'IR_MM' is my user parameter for the output table name. For the Attribute Exposer transformer, I typed in "fme_feature_type" as it wasn't coming up as an option in the drop down. Then for the Attribute Manager, I set the value of fme_feature_type to my user parameter "$(OUTPUT_table_name)" . I didn't make any changes to the dynamic writer this time around, table name remains as "fme_feature_type".attribute manager

Where did you place the AttributeManager in your workspace (a screenshot if possible would help)? The fme_feature_type attribute will be used to match the schema to the corresponding features, so the schema and the features themselves will need to have their fme_feature_type value changed so that they match before reaching the Dynamic Writer.


marronm
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • December 21, 2023

@danminneyatsaf​  I put that AttributeManager in between AttributeExposer and Writer

image


danminneyatsaf
Safer
Forum|alt.badge.img+12
marronm wrote:

@danminneyatsaf​  I put that AttributeManager in between AttributeExposer and Writer

image

Hi @marronm,​ apologies for the delayed reply as I was off during the Christmas holidays.

The Schema features use the fme_feature_type_name attribute to match up with the corresponding features, which is why you're receiving a warning saying that the schema information is missing.

 

Create a separate set of AttributeExposer + AttributeManager transformers for the Schema data coming from each of the FeatureReaders and then connect these to the Dynamic Writer. See the image below for an example.

image 

In the AttributeManager, set the value for the fme_feature_type_name & the fme_feature_type attributes to $(OUTPUT_table_name).

image 

Try giving your workspace another run and let me know if that works for you.


marronm
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • January 5, 2024
danminneyatsaf wrote:

Hi @marronm,​ apologies for the delayed reply as I was off during the Christmas holidays.

The Schema features use the fme_feature_type_name attribute to match up with the corresponding features, which is why you're receiving a warning saying that the schema information is missing.

 

Create a separate set of AttributeExposer + AttributeManager transformers for the Schema data coming from each of the FeatureReaders and then connect these to the Dynamic Writer. See the image below for an example.

image 

In the AttributeManager, set the value for the fme_feature_type_name & the fme_feature_type attributes to $(OUTPUT_table_name).

image 

Try giving your workspace another run and let me know if that works for you.

@danminneyatsaf​ Worked a dream - thank you for all your help


cstodd
Contributor
Forum|alt.badge.img+3
  • Contributor
  • June 24, 2025
danminneyatsaf wrote:

The issue with the AttributeExposer not retaining the order of the attributes is a known bug with the transformer. We currently have a ticket open regarding this issue (FMEFORM-25548). I've added this question to the ticket so you get notified when the issue is resolved.

@danminneyatsaf what is the status of the ticket regarding the order of attributes bug with the AttributeExposer? I am using FME Form 2025.0.3 build 25241.


danminneyatsaf
Safer
Forum|alt.badge.img+12

Hi ​@cstodd, the fix for the issue is currently planned for FME 2025.2. If this issue is affecting your workflows or authoring experience in any way please let me know and I can forward the feedback to our product management team.

FYI: The ticket number you mentioned is a duplicate that has been closed. The correct ticket number that is currently tracking the fix is FMEFORM-32886.

 

Regards,

Dan


cstodd
Contributor
Forum|alt.badge.img+3
  • Contributor
  • June 26, 2025
danminneyatsaf wrote:

Hi ​@cstodd, the fix for the issue is currently planned for FME 2025.2. If this issue is affecting your workflows or authoring experience in any way please let me know and I can forward the feedback to our product management team.

FYI: The ticket number you mentioned is a duplicate that has been closed. The correct ticket number that is currently tracking the fix is FMEFORM-32886.

 

Regards,

Dan

@danminneyatsaf I have a workflow that is creating a report as a Word document and to be able to create some of the tables, I need the AttributeExploder to transpose the attribute names, but they are then being reordered alphbetically by the AttributeExploder, when the report needs the original order to be preserved.


danminneyatsaf
Safer
Forum|alt.badge.img+12

@cstodd thanks for sharing the feedback. Before I add it to the ticket, I just wanted to double-check that you’re using the AttributeExposer and not the AttributeExploder like you mentioned in your post?


cstodd
Contributor
Forum|alt.badge.img+3
  • Contributor
  • June 26, 2025

@danminneyatsaf oh I misread the original post! I’m using the AttributeExploder which also orders everything alphabetically. I guess that will not be dealt with in 2025.2 then?


danminneyatsaf
Safer
Forum|alt.badge.img+12

@cstodd I took a look and we currently don’t have any tickets open tracking the AttributeExploder attribute ordering. Would you be able to submit a new Idea to our Product Ideas page on the community? 

 


Reply


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