Hello ,
I'm trying to dynamically map rest api to sql server using copy task with an example json output as below
{
"country_code":"US",
"alerts":[
{
"regions":[
"Madison",
" Franklin"
],
"ends_utc":"2020-10-17T13:00:00",
"onset_local":"2020-10-17T02:00:00",
"description":"* temperatures low and high winds ."
}
],
"city_name":"Dayton",
"state_code":"OH"
}
with
a map expression
as below
@json(' {
"type": "TabularTranslator",
"mappings": [ { "source": { "path": "$[''alerts''][0][''description'']"
},
"sink": {
"name": "description",
"type": "String"
}
},
{
"source": {
"path": "$[''city_name'']"
},
"sink": {
"name": "city_name",
"type": "String"
}
}
],
"collectionReference": "",
"mapComplexValuesToString": true
}')
The out put is only getting values for city but not for description.