Skip to main content
Solved

Attribute Exposer many fields?

  • December 10, 2021
  • 5 replies
  • 103 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

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, 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.

5 replies

ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3422 replies
  • 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+63
  • Celebrity
  • 1620 replies
  • 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+23
  • Enthusiast
  • 83 replies
  • December 12, 2021

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
  • 571 replies
  • 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+63
  • Celebrity
  • 1620 replies
  • December 13, 2021

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