I have a JSON schema where some object keys start with a number. The JSON Parse tool reads them as I would expect for Alteryx, but when using the JSON Build tool (using the results of the parse) it outputs them as an array rather than as an object with keys.
Additionally, when the object contains keys that start with a number and a character, this causes malformed JSON output (missing key value).
Is there an easy work-around for this, or will I just have to build my JSON manually using the Formula tool? Any advice is appreciated, thanks.
Sample JSON Input:
{
"Store":"Flagship",
"Product":{
"First":"Apples",
"Second":"Beets",
"Third":"Corn"
},
"Sales Rank":{
"1st":"Apples",
"2nd":"Beets",
"3rd":"Corn"
},
"Employees":{
"Captain":"Alice",
"1st Mate":"Bob"
}
}
JSON Parse Tool Output:
| JSON_Name | JSON_ValueString |
| Store | Flagship |
| Product.First | Apples |
| Product.Second | Beets |
| Product.Third | Corn |
| Sales Rank.1st | Apples |
| Sales Rank.2nd | Beets |
| Sales Rank.3rd | Corn |
| Employees.Captain | Alice |
| Employees.1st Mate | Bob |
JSON Build Output (new lines added for clarity):
{
"Store":"Flagship",
"Product":{
"First":"Apples",
"Second":"Beets",
"Third":"Corn"
},
"Sales Rank":
["Apples",
"Beets",
"Corn"],
"Employees":
{
"Captain":"Alice",
["Bob"]
}
}