Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

JSON output

ccaprio
7 - Meteor

Hi,

 

I am looking for information on how to create a JSON output file. I have 4 separate inputs and would like each input file to have a separate array within the JSON output. For example input 1 = metadata; input 2= transactions. I would like to have 1 array named metadata and one named transactions. Any recommendations?

 

Thanks!

4 REPLIES 4
AmeliaG
Alteryx
Alteryx

Hi @ccaprio,

 

The JSON Build tool will allow you to do this. In your scenario, the "Input" field would be used as a grouping field. Note: Prior to the data going into the JSON build tool, it should already be in Name:Value pairs which you can achieve using the Transpose tool.

 

To output this JSON, you will add an Output data tool after the JSON Build tool. Because it is already in the JSON format, it would be best to output to a txt format. 

 

Hope this helps!

 

Amelia

ccaprio
7 - Meteor

Thanks Amelia,

 

After using the transpose> JSON build tool I am left with 4 separate inputs and mini workflows. I added the union tool but this does not accomplish the goal output. I attached an image of my current workflow.

 

How do I bring this all together to name each input source as a separate array? For example input 1 = metadata: {insert array}.

 

Cari

AmeliaG
Alteryx
Alteryx

Hi @ccaprio,

 

In your workflow you should Union the transposed data prior to using the JSON Build tool. (See screenshot of workflow below)

 

JSON build workflow.png

In the JSON build tool, your input source field (i.e. a field that says metadata, etc) will be used as the 'Grouping' field. In my screenshot below, this field is called 'Source'. If an input source field does not currently exist in your data, then add a 'Formula' tool to create this field. 

 

JSON Build Example.png

 

Have a great day!

 

Amelia

cbz
8 - Asteroid

@AmeliaG 

 

Hi

 

I have tried to use the suggested method but i have got output as the "Append Json ouput" attachment,

 

But what i am looking for is something like the attachment "Sample append Json output"

 

Would you be able to advise please?

 

 

Thanks

 

Chunbin

Labels