Hello,
I am attaching my correct excel input however right after json build tool backslashes get added to my final output. which shouldn't be the case. below is the attached final output as well as the workflow.
Below is the actual output i should be getting in the json format.
[
{
"areaCode": "12345",
"areaName": "12345_name",
"State": {
"City": ["York","Mills","Flushing"],
"Zip": "11800"
},
"Country": {
"NA": "America",
"EU": "Germany"
}
},
{
"areaCode": "23451",
"areaName": "23451_name",
"State": {
"City": ["Mills","Flushing"],
"Zip": "10000"
},
"Country": {
"NA": "Canada",
"EU": "Spain"
}
},
{
"areaCode": "34512",
"areaName": "34512_name",
"State": {
"City": [""],
"Zip": "30000"
},
"Country": {
"NA": "Canada",
"EU": "Spain"
}
}
]
Solved! Go to Solution.
Why don't you add a formula tool to remove the backslashes?
@jakaur32The reason why this is happening is because the Alteryx likes you to input arrays in this format:
However if you don't want to correct your data that way you can just use a replace formula like this:
Replace([JSON], "\", "")
Any questions or issues please ask :)
HTH!
Ira
this almost works however when i am doing this action there is one issue. the value for city should begin with square bracket and not quotations.
Current Output
[
{
"areaCode": "12345",
"areaName": "12345_name",
"State": {
"City": "["York","Mills","Flushing"]",
"Zip": "11800"
},
"Country": {
"NA": "America",
"EU": "Germany"
}
},
{
"areaCode": "23451",
"areaName": "23451_name",
"State": {
"City": "["Mills","Flushing"]",
"Zip": "10000"
},
"Country": {
"NA": "Canada",
"EU": "Spain"
}
},
{
"areaCode": "34512",
"areaName": "34512_name",
"State": {
"City": "[""]",
"Zip": "30000"
},
"Country": {
"NA": "Canada",
"EU": "Spain"
}
}
]
Expected Output
[
{
"areaCode": "12345",
"areaName": "12345_name",
"State": {
"City": ["York","Mills","Flushing"],
"Zip": "11800"
},
"Country": {
"NA": "America",
"EU": "Germany"
}
},
{
"areaCode": "23451",
"areaName": "23451_name",
"State": {
"City": ["Mills","Flushing"],
"Zip": "10000"
},
"Country": {
"NA": "Canada",
"EU": "Spain"
}
},
{
"areaCode": "34512",
"areaName": "34512_name",
"State": {
"City": [""],
"Zip": "30000"
},
"Country": {
"NA": "Canada",
"EU": "Spain"
}
}
]
@jakaur32 - Just mark that either one of these is a solution and can be closed 😀
User | Count |
---|---|
35 | |
27 | |
8 | |
7 | |
7 |