Skip to main content
Solved

Attribute Exposer many fields?

  • December 10, 2021
  • 5 replies
  • 69 views

Forum|alt.badge.img

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

Best answer by hkingsbury

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

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

5 replies

ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • December 10, 2021

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.


hkingsbury
Celebrity
Forum|alt.badge.img+55
  • Celebrity
  • Best Answer
  • December 12, 2021

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


milo89
Enthusiast
Forum|alt.badge.img+16
  • Enthusiast
  • December 12, 2021
hkingsbury wrote:

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?

 


caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • December 13, 2021

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

From Dataset


hkingsbury
Celebrity
Forum|alt.badge.img+55
  • Celebrity
  • December 13, 2021
milo89 wrote:

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


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