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"]
}
]
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"]
}
]
Hi @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:
t{"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:
t{"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:
t{"CITY":<"Frankfurt","Hamburg","Berlin"]}]
Thank you for endorsing the response
Hi, thanks for your help ... especially @david_r whose tip has brought the desired result.
Greetings Steffen