I want to output a feature with a list (CITY) into a correct JSON array as described below. However, that does not work. Can somebody help me with it?
[
{
"CITY" : ["Frankfurt","Hamburg","Berlin"]
}
]
Best answer by david_r
View originalI want to output a feature with a list (CITY) into a correct JSON array as described below. However, that does not work. Can somebody help me with it?
[
{
"CITY" : ["Frankfurt","Hamburg","Berlin"]
}
]
Best answer by david_r
View originalHi @sieblist
After the transformer ListBuilder use the ListConcatenator.
And the transformer JSONTemplater to create your template:
Thanks,
Danilo
Please, see this Workspace template FMWT.
I changed the transformer JSONTemplater:
Thanks, - 27541-problem-none2json-danilo.fmw
Danilo
There's probably no need to use the JSONTemplater here, it comes with it's own set of challenges.
After the ListBuilder, insert a ListRenamer to make the list correspond to what the JSON writer expects:
This will rename city_list{}.CITY to just CITY{}
Result:
[{"CITY":["Frankfurt","Hamburg","Berlin"]}]
There's probably no need to use the JSONTemplater here, it comes with it's own set of challenges.
After the ListBuilder, insert a ListRenamer to make the list correspond to what the JSON writer expects:
This will rename city_list{}.CITY to just CITY{}
Result:
[{"CITY":["Frankfurt","Hamburg","Berlin"]}]
Here's the complete workspace: json_list.fmwt
There's probably no need to use the JSONTemplater here, it comes with it's own set of challenges.
After the ListBuilder, insert a ListRenamer to make the list correspond to what the JSON writer expects:
This will rename city_list{}.CITY to just CITY{}
Result:
[{"CITY":["Frankfurt","Hamburg","Berlin"]}]
Thank you for endorsing the response
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.