Skip to main content
Solved

Translate JSON return to table form

  • June 3, 2024
  • 3 replies
  • 88 views

waterbeemds
Contributor
Forum|alt.badge.img+5

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.

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.

3 replies

andrewj74
Supporter
Forum|alt.badge.img+7
  • 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+60
  • 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+5
  • 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