Skip to main content
Solved

Translate JSON return to table form


waterbeemds
Contributor
Forum|alt.badge.img+3

Hi,

 

I have a JSON return form a HTTPCaller with schema info. An example of the return looks like this:

{
  "name": "Administration",
  "properties" : {
    "Id" : {
      "type" : "number",
      "required" : true,
      "description" : "The given Id for the object"
    },
    "GeoType" : {
      "type" : "string",
      "required" : true,
      "description" : "The type of object"
    },

The json continues here with more schema info.

I want to turn the information into a table like this: 
 

I have 82 other JSON returns with the same layout but other “name” values and exposing them all takes to much time. I have tried to use JSON transfromers but so far no succes.
Is there a more dynamic solution to transforming the return to my desired solution?

Thanks in advance,

Sander

Best answer by geomancer

This works (after adding curly closing brackets to the given input):

Also see the attached workspace.

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

3 replies

andrewj74
Supporter
Forum|alt.badge.img+5
  • Supporter
  • June 3, 2024

See this one here that should help: 

 

can you expose the attributes using the attribute exposer > cached features? or do you want it to be dynamic? if you want it to be dynamic you could use the schema scanner and set up a dynamic writer.


geomancer
Evangelist
Forum|alt.badge.img+47
  • Evangelist
  • Best Answer
  • June 3, 2024

This works (after adding curly closing brackets to the given input):

Also see the attached workspace.


waterbeemds
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • June 3, 2024

Hi andrewj74 and geomancer,

Thank you for your responses. Geomancer's solution worked for me and will set it as Best Answer.

I also managed to make a solution using the AttributeExploder after the first JSONFragmenter.
But it uses more transformers in the long run and Geomancer's solution is more in line with the format.

Thanks,

Sander


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