Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Json Builder Output

tjamal1
8 - Asteroid

I am using Json Build option to create a json ouput file but the problem is that I dont need my records inside an object 

 

For example 

The output Alteryx is producing is 

{
"Record": [
{
"Customer Number": null,
"Customer Name": "Tariq Jamal",
"Email": "tariq003@syntio.com",
"Phone": "4169951111",
"City": "Toronto",
"Status": "Activated",
"Last Modeified": "2019-10-24 08:53:45",
"CVP Card": "2005267074657860000"
},
{
"Customer Number": null,
"Customer Name": "Jeff V",
"Email": "jeffv@gmail.com",
"Phone": "5325737363",
"City": "Oakville",
"Status": "Activated",
"Last Modeified": "2019-04-24 09:20:48",
"CVP Card": "1025753780104880000"
}

]

}

 

But i need 

 [
{
"Customer Number": null,
"Customer Name": "Tariq Jamal",
"Email": "tariq003@syntio.com",
"Phone": "4169951111",
"City": "Toronto",
"Status": "Activated",
"Last Modeified": "2019-10-24 08:53:45",
"CVP Card": "2005267074657860000"
},
{
"Customer Number": null,
"Customer Name": "Jeff V",
"Email": "jeffv@gmail.com",
"Phone": "5325737363",
"City": "Oakville",
"Status": "Activated",
"Last Modeified": "2019-04-24 09:20:48",
"CVP Card": "1025753780104880000"
}

]


I am attaching my workflow  

2 REPLIES 2
DiganP
Alteryx Alumni (Retired)

@tjamal1 The reason why the record tag is being created is you can't create an array at the top level without having having a array. 

 

What you can do is use the formula tool to update the JSON file created.

Replace([JSON], '{"Record":', '')

Replace([JSON], Right([JSON], 3), '}]')

These formulas will remove the Record: and fix the JSON brackets. 

Digan
Alteryx
DiganP
Alteryx Alumni (Retired)

@tjamal1 Attached is the workflow. 

Digan
Alteryx
Labels
Top Solution Authors