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

Alteryx Designer Desktop Discussions

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

Undesired characters in the string output

DFstr
7 - Meteor

Hi everyone,

I'm working with a JSON file in Alteryx that needs cleaning and parsing. Everything seems fine within Alteryx, but when I export the data as a .csv file (in UTF-8 format), I encounter issues with extra double quotes ("), slashes (/), and newline characters (\n). Here’s an example to illustrate what’s happening:

 

Current Output:

 

{
"type": "radio",
"id": "67",
"formId": "2052",
"label": "Wie war dein Familienstand im Jahr @{F:1}?",
"adminLabel": "",
"isRequired": "1",
"errorMessage": "",
"visibility": "visible",
"choices": [
{
"text": "ledig",
"value": "1",
"isSelected": "0",
"tooltipContent": "{\"title\":\"Ledig\",\" content\":\"\n<p>Dieser Status bezieht sich auf Personen, die am Ende des Jahres weder verheiratet, verwitwet noch geschieden waren. Bei Vorliegen einer dieser Bedingungen ist die Einstufung als \"ledig\" nicht möglich.</p>\n\"}",

 

 

Desired Output:

 

"type": "radio",
"id": 67,
"formId": 2052,
"label": "Wie war dein Familienstand im Jahr @{F:1}?",
"adminLabel": "",
"isRequired": "1",
"errorMessage": "",
"visibility": "visible",
"choices": [
{
"text": "ledig",
"value": "1",
"isSelected": "0",
"tooltipContent": {"title":"Ledig"," content":"<p>Dieser Status bezieht sich auf Personen, die am Ende des Jahres weder verheiratet, verwitwet noch geschieden waren. Bei Vorliegen einer dieser Bedingungen ist die Einstufung als "ledig" nicht möglich.</p>"}.

 

 

As you can see, I want to remove unnecessary quotes around certain numeric values (BUT not all of them - only "id" and "formdID")and properly format the tooltipcontent without escape characters. Although I've used the Replace tool and StripQuotes in Alteryx to clean the data, these unwanted characters still appear in the final output.

 

So yes, certain pairs - like form ID and ID should not have "". I was able to clean the data in alteryx with replace tool, but I after the file will be written I got this undesired charachets.

 

I thried to use /t and /0 as delimiters. Quote output fields is "Never" but it is still not working.

 

Thanks!

 

6 REPLIES 6
DFstr
7 - Meteor

Here is an file thet could be used as an example

caltang
17 - Castor
17 - Castor

Can you export the workflow? It's a bit hard to visualize and help without it...

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
DFstr
7 - Meteor

Sure, thanks!

caltang
17 - Castor
17 - Castor

Hmm, well because I'm not hooked up to your system, I can't see/check everything. But if you're facing the extra quotes in the numeric portions, you can try something like this:

  • Find: "(id|formId)": "(\d+)"

  • Replace: "\1": \2

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
DFstr
7 - Meteor

Thanks but this won´t help, as the problem occurs only when Alteryx prepares the output file - means in the Output tool. 

binuacs
21 - Polaris

@DFstr Try the attached workflow

image.png

Labels