Skip to main content
Solved

How to sort column names in Table View (Visual Preview)

  • April 11, 2024
  • 6 replies
  • 133 views

ed-progres
Contributor
Forum|alt.badge.img+1


Hi FME folks,

Is it possible to sort the column names in the Table View in the Visual Preview alphabetically?
It's frustrating to have to scroll all the way to the right to find a column that starts with an “a”...
 



Thanks!

Best answer by tomfriedl

You can quickly change the displayed columns temporarily:

but again next time ...

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

6 replies

nielsgerrits
VIP

This can be done using the AttributeManager.


ed-progres
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • April 11, 2024
nielsgerrits wrote:

This can be done using the AttributeManager.

Can you please elaborate a bit more Niels?
I hope I don't have to drag all the Attributes manually to rearrange them alphabetically in the AttributeManager. 


tomfriedl
Contributor
Forum|alt.badge.img+13
  • Contributor
  • Best Answer
  • April 11, 2024

You can quickly change the displayed columns temporarily:

but again next time ...


j.botterill
Influencer
Forum|alt.badge.img+36
  • Influencer
  • April 11, 2024

Definitely ordering your fields/attributes in AttributeManager with the Up and Down buttons is the way to go. Also consider voting up my FME idea about saving table view columns for reuse Visual Preview - Preset/Saved Column Selections | Community (safe.com)


ed-progres
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • October 21, 2024

Bump.

I'm a bit fed up having to manually reorder everything in the AttributeManager.

Would a Python script work here?
If yes, can someone write it? 😅
 


bwn
Evangelist
Forum|alt.badge.img+26
  • Evangelist
  • October 21, 2024

@ed-progres  Here is a kludge way of doing it “reasonably” easily.

You can get AttributeManager to remap the Attributes in Sorted Order by re-adding them to the bottom of the AttributeManager with the Import Tool that allows Attributes to be added .  The way this works is that this causes AttributeManager to remap the Schema with any overrides at the bottom of the AttributeManager operations since AttributeManager executes each line of requested operation (Rename, Remove, Do Nothing etc.) in the order they appear in AttributeManager

Do this with the “Import” Tool, and get it to re-add the Attributes to the bottom but now in Sorted order.  Doesn’t matter that the same Attributes appear in the Dialog twice, because in execution AttributeManager just executes line by line, this causes it to reorder the Attributes as they are in the last line items.

Caveat is that needs to have Partial Run/Feature Cache available to map from, or an Eg. External Dataset to Import (Eg. Excel, Text/CSV etc. list of Attributes)

Anyway, going to use a Feature Cache example.

Pre-change workspace with unordered Attributes.
 


Use the AttributeManager “Import” Tool


Select All Attributes, and add them as new Output lines in Sorted Order
 

 

...re-adds the Attributes to the end of AttributeManager’s operations, but will reorder since they are the last operations to execute.

 



Changes the Workspace Scheme to now have Sorted Attributes 😉

 

 


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