community
cancel
Showing results for 
Search instead for 
Did you mean: 
Do you have the skills to make it to the top? Subscribe to our weekly challenges. Try your best to solve the problem, share your solution, and see how others tackled the same problem. We share our answer too.
Weekly Challenge
Do you have the skills to make it to the top? Subscribe to our weekly challenges. Try your best to solve the problem, share your solution, and see how others tackled the same problem. We share our answer too.
Unable to display your progress at this time. Please try again a little later, or contact an administrator if you continue to see this error.
Getting started with Designer? | Start your journey with our new Learning Path!

Challenge #114: Think Like a CSE...Remove the extra delimiter from the JSON output

Alteryx
Alteryx

A solution to last week's challenge can be found here!

 

We are thrilled to present another Challenge from our “Think like a CSE” series, brought to you by our fearless team of Customer Support Engineers. Each month, the Customer Support team will ask Community members to “think like a CSE” to try to resolve a case that was inspired by real-life issues encountered by Alteryx users like you! This month we present the case of the incorrect JSON formatting.

 

Below, we’ve provided the information that was initially available to the Customer Support Engineer who resolved the case. It’s up to you to use this information to put a solution together for yourself.

 

The Case: A co-worker is trying to build an app that requires a JSON file as an input.  He has created a workflow in Designer to produce this JSON file.  The problem? The .JSON file is created but, after opening the file, he notices that it contains backslashes ‘\’ that should not be there (shown in fuschia below). For example:

[

    {

        "JSON": "{\"Record\":[{\"email\":\"ThinkLikeaCSE@alteryx.com\",\"mobile\":\"1-800-ALT-ERYX\",\"category\":\"Active\",\"cityPreference\":\"Irvine\",\

...

    }

]

 

He cannot use this file to build his app, as it is not the proper format. Even more puzzling?  When he reads in the .JSON file in Designer, the backslashes do not appear.  What’s going on?

 

Your GoalCreate an output without the extra delimiter ‘\’. 

 

Asset Description: The co-worker is desperate and has shared the workflow he uses, which includes a workflow (included in the start file).

 

Spoiler
(view in My Videos)

 

Digan
Alteryx
Alteryx Certified Partner

This was easier than I thought it would be...

 

Spoiler
With a little help from the awesome community, I did a search and found this post: https://community.alteryx.com/t5/Data-Sources/Writing-JSON-Files-Wrong-Syntax/td-p/10421

Which gave the answer!

114.PNG
Highlighted
Asteroid

We've run into similar problems, 

 

Spoiler
non-delimited .csv's solve everything.
Screen Shot 2018-04-30 at 10.36.05 AM.png
Asteroid

I had no clue on this one but easily found a solution on the community website.

 

Spoiler

 

Capture.JPG

 

Asteroid

Here is my "solution"... 

Let me know if I messed it up, and I'll try another approach. (EDIT: I see other people used the same technique, so I feel ok now)

 

Spoiler
Feels like cheating, but I just changed the output file type to Comma-Delimited Text Files (*.csv), it seems to produce the desired output...

 

Meteor
 
Alteryx Partner
 

Solution

Spoiler
Capture.PNG
Alteryx Certified Partner

Challenge #114 done

Spoiler
Workflow.pngWorkflow
Works either by writing as HTML before extracting content or by just writing to CSV without delimiters nor header extraction