Free Trial

Weekly Challenges

Solve the challenge, share your solution and summit the ranks of our Community!

Also available in | Français | Português | Español | 日本語
IDEAS WANTED

Want to get involved? We're always looking for ideas and content for Weekly Challenges.

SUBMIT YOUR IDEA

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

DiganP
Alteryx Alumni (Retired)

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

 

Digan
Alteryx
LordNeilLord
15 - Aurora

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
bdaniels
8 - 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
kcgreen
8 - Asteroid

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

 

Spoiler

 

Capture.JPG

 

mmongeon
8 - 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...

 

leesin
7 - Meteor
 
aikennedy
5 - Atom
 
ShshankChawathay
7 - Meteor

Solution

patrick_digan
17 - Castor
17 - Castor
Spoiler
Capture.PNG
MMehdi
8 - Asteroid

Challenge #114 done

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