Skip to main content
Solved

Change order of attributes (outside the writer)


I'm working on distributing data from a public administration. The data are documented in reports which describe the signification of each attribute. It's important to us that the attributes in the data appear in the same order as described in the document.

 

 

To do that attributes ordering, I used to move each user attribute up or down in the writer's "Feature Type Properties" window. This works very well... until I change the output :-(

 

 

So my question is : is it possible to change the order of attributes with a transformer (outside the writer) ? An 'AttributeSorter' or 'AttributeOrganizer' transformer would be perfect for this.

 

 

Thank you for your help !

 

 

Best regards,

 

Samuel

Best answer by david_r

Hi

 

 

The short answer is no, it's not possible, you have to define the attribute order on the output feature type.

 

 

The long answer is that it might be possible using the following advanced technique: Use the SchemaSetter (https://store.safe.com/transformers/schemasetter) to extract the schema definition from each passing feature. Sort the resulting attributes{}-list according to your needs, then send the features to a dynamic writer set to use the schema defined in the list attributes{}. Use this article as a starting point: https://knowledge.safe.com/articles/Samples_and_Demos/Dynamic-Workflow-Tutorial-Destination-Schema-is-Derived-from-List-Attributes

 

 

David
View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, 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.

david_r
Evangelist
Hi

 

 

The short answer is no, it's not possible, you have to define the attribute order on the output feature type.

 

 

The long answer is that it might be possible using the following advanced technique: Use the SchemaSetter (https://store.safe.com/transformers/schemasetter) to extract the schema definition from each passing feature. Sort the resulting attributes{}-list according to your needs, then send the features to a dynamic writer set to use the schema defined in the list attributes{}. Use this article as a starting point: https://knowledge.safe.com/articles/Samples_and_Demos/Dynamic-Workflow-Tutorial-Destination-Schema-is-Derived-from-List-Attributes

 

 

David

  • July 14, 2015
Thank you. I will try the "long answer", and I hope the short one will be available for FME 2016 ;-)

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