FME Desktop 2020: How to permanently reorder the fields of attribute table of geodatabase feature class?
In the screenshot below, I wanted to permanently move F3 to be to the right of F1. Which tool can be of help on this?
FME Desktop 2020: How to permanently reorder the fields of attribute table of geodatabase feature class?
In the screenshot below, I wanted to permanently move F3 to be to the right of F1. Which tool can be of help on this?
I don't think you can change the order in the FeatureClass, other then re-arrange and then rewrite the table. But in Workbench you can use the AttributeManager for another order. Actually, this is the only thing I use the AttributeManager for.
I performed the “attributemanager” tool but appears that the output feature class don’t have the fields ordered.
What could be the issue here?
I performed the “attributemanager” tool but appears that the output feature class don’t have the fields ordered.
What could be the issue here?
Ah I misunderstood. In the Writer, tab User Attributes, change that order should do it.
Ah I misunderstood. In the Writer, tab User Attributes, change that order should do it.
not sure why this appears not to work. the output still keeps the fields as they are in the input!
what might be the issue?
Ah I misunderstood. In the Writer, tab User Attributes, change that order should do it.
Try not dynamic but manual. Dynamic tries to reproduce the source schema, and that is what you want to change.
Ah I misunderstood. In the Writer, tab User Attributes, change that order should do it.
Even with manual option, the fields of the attribute table don’t respect the attribute definition.
What could be the issue here?
Ah I misunderstood. In the Writer, tab User Attributes, change that order should do it.
Are you re-creating the target feature class, or simply truncating the table? You'll need to drop and recreate the table for changes in attribute order.
Ah I misunderstood. In the Writer, tab User Attributes, change that order should do it.
Thanks David
It appears that reordering the fields with the attributemanager tool fails as per the screenshot below.
What could be the issue here?
Ah I misunderstood. In the Writer, tab User Attributes, change that order should do it.
Two things:
Further, the FME Visual Preview is not the Geodatabase Schema. This does not "show" you what the resulting Geodatabase Schema and Field Order is, that is instead set by the Writer. The FME Visual Preview/Inspector only shows the FME Workspace Schema.
What has happened here, is the Writer was first created without the AttributeManager first being inserted to re-order the fields. The Writer intialised its Schema in the field order that existing in the Workspace at the time and replicated the field order in the Reader. Changing the order in AttributeManager does nothing once a Writer Schema Definition has already been manually set by itself, instead the Writer Schema needs to be changed within the Writer settings to change Field Order.
For most use cases, I manually set the output Schema within the Writer to get the desired field order, field types and field names (and I also drop ObjectID. This is a Geodatabase System controlled field and cannot be written out to a GDB), with the exception of when I use Dynamic Reader/Writers but even those the Writer settings can override the FME Workspace Schema.
Ah I misunderstood. In the Writer, tab User Attributes, change that order should do it.
The issue persists to exist. The output doesn’t respect the fields order set in the attributemanager anyway.
All what I did is that the F3 field is moved to be before F1. The output feature class keeps the original order and doesn’t respect what is set in attributemanager
What could be the issue?
The data and workbench are attached
Thanks bwn
Doesn’t this mean that there is no chance to order the fields the way we like anyway?
Ah I misunderstood. In the Writer, tab User Attributes, change that order should do it.
The issue is that the target feature class already exists with the "wrong" attribute order. And since you haven't told FME to re-create the feature class, there are no changes made to the table structure, only the content is added. You will have to configure the table handing to drop and create for the schema to be updated:
Hi David,
Even with “drop and create” option, the order is not repected.
Has it worked with you?
Hi David,
Even with “drop and create” option, the order is not repected.
Has it worked with you?
Please stop using the AttributeManager for attribute order outside the workspace.
You need to change the order in the Writer, not in the AttributeManager.
Only use the AttributeManager if you want to change the order in the visual preview / inspector.
I wish I never mentioned the AttributeManager :P
Thanks nielsgerrits.
Finally it works with “manual” option as per the screenshot below.
Thanks for the patience
Hi David,
Even with “drop and create” option, the order is not repected.
Has it worked with you?
If you want to preserve the attribute order set in the AttributeManager, you'll have to configure the output feature type to use automatic attribute definition. If you set it to manual, the order defined in the output feature type overrides the AttributeManager.
If you want to preserve the attribute order set in the AttributeManager, you'll have to configure the output feature type to use automatic attribute definition. If you set it to manual, the order defined in the output feature type overrides the AttributeManager.
Thanks David. It works like a charm with this option too!
Very much appreciated
Thanks bwn
Doesn’t this mean that there is no chance to order the fields the way we like anyway?
FME can absolutely Write the Schema in the Field order required, however it depends on the use case:
1. The default, and easiest way to understand, is to change the "Attribute Definition" within the Writer to "Manual", and to change the Writer Mode to "Drop and Create" (or set the Writer to Overwrite the entire Geodatabase in the Writer Parameters). In this configuration, it doesn't matter what the Workspace does with the FME Schema, the Writer will override the output to a Fixed Schema that you have set within the Writer and so this guarantees a consistent Schema output no matter how you change the Workspace design. As @david_r points out though, if it is an existing Feature Class that is being written to, to change the order of fields requires either for the Feature Class to be Dropped (Deleted) in the Writer Mode, or alternatively in ArcCatalog to change the field order there. FME can't change the order of fields on an existing GDB feature class, so it needs to be dropped and written from scratch or changed within ArcGIS
2. The Writer Schema can be, at least temporarily, "reset" by changing the Writer Attribute Definition to "Automatic", which will reset the Writer Schema to match the FME Workspace Schema and change the Writer to have the Field Names and Field Order currently existing in the Workspace, and is useful for sometimes "reorganising" a Manual Schema by changing the setting briefly to Automatic and then back to Manual.
3. The hardest to understand and get used to, but the most powerful and flexible, is to set the Writer Attribute Definition to "Dynamic" which can be a mixture of a Dynamic and Fixed Schemas. Dynamic writing is a separate topic. For the moment, I would instead just use Manual and learn that mode first.
Please stop using the AttributeManager for attribute order outside the workspace.
You need to change the order in the Writer, not in the AttributeManager.
Only use the AttributeManager if you want to change the order in the visual preview / inspector.
I wish I never mentioned the AttributeManager :P
Yes, AttributeManager does not change the Writer Schema, it only changes the FME Workspace Schema. The Writer controls the GDB Written Schema, not AttributeManager.
AttributeManager CAN be used to proxy set the Writer Schema, but only when the Writer has been set to automatically/dynamically adjust its Writer Schema to match the FME Workspace Schema. 🙂
Thank you very much guys for the help. Your input is very useful
Best
Jamal
Ah I misunderstood. In the Writer, tab User Attributes, change that order should do it.
you have to set the output to manual. See attached gdb output.