Solved

Attribute Exposer many fields?

  • 10 December 2021
  • 5 replies
  • 9 views

Badge

I'm reading a number of json files each with their own set of records. I can see I need to expose many attributes but without adding hundreds of lines (the index goes to 142). Is there any easy way to go from screengrab below to web site structure at http://reg.bom.gov.au/products/IDT60801/IDT60801.94850.shtml:From

icon

Best answer by hkingsbury 12 December 2021, 22:21

View original

5 replies

Userlevel 1
Badge +21

When you say index do you mean you have fields which are like observations.data{142}.[attributename] ?

Because that number relates to the number of features in the list, not the number of attributes.

 

If you explode the observations.data list, you can then expose the attributes to get a similar sort of data structure to the web page. If you are using 2020 or above, you can use the feature cache to automatically populate the attributes to expose.

Userlevel 5
Badge +29

have a look at the attached. Makes use of the JSONFragmenter to both read the JSON and break it down

Userlevel 2
Badge +11

have a look at the attached. Makes use of the JSONFragmenter to both read the JSON and break it down

Hi @hkingsbury​,

I think this is a great answer to this problem.

Quick question, do your output attributes sort alphabetically even when Sort Attributes = 'None' in the SchemaSetter?

 

Badge +20

You can save one JSON file to disk and use Import -> From Dataset in AttributeExposer

From Dataset

Userlevel 5
Badge +29

Hi @hkingsbury​,

I think this is a great answer to this problem.

Quick question, do your output attributes sort alphabetically even when Sort Attributes = 'None' in the SchemaSetter?

 

I faced this exact issue yesterday on a completely unrelated (to this) piece of work. Short answer is reorder fields in attribute manager doesn't change the actual order of the attributes. So the 'none' in the SchemaSetter is not really doing anything.

 

Here are some other articles on the matter:

https://community.safe.com/s/question/0D54Q000080h9d8SAA/change-order-of-attributes-outside-the-writer

https://community.safe.com/s/question/0D54Q00008FXH6bSAH/fme-desktop-2020-how-to-permanently-reorder-the-fields-of-attribute-table-of-geodatabase-feature-class

https://community.safe.com/s/question/0D54Q000080hC3L/attribute-order-keeping

Reply