I need to extract data from REST API in ADF, which I am doing using WEB activity and COPY activity.
When used Web activity, I am getting extra \
in response as below.
{
"Response": "[{\"Name\":\"Countries\",\"Url\":\"/api/Datab/abc\",\"Trees\":[{\"Name\":\"Economics Locations\"},{\"Name\":\"Economics Indicators\"}]},{\"Name\":\"Global\",\"Url\":\"/api/Datab/def\",\"DatabankCode\":\"WDMacro\",\"StartYear\":1980,\"EndYear\":2050,\"HasQuarterlyData\":true,\"Trees\":[{\"Name\":\"Global Economics Locations\"},{\"Name\":\"Global Economics Indicators\"}]}]",
"ADFWebActivityResponseHeaders": {
"Pragma": "no-cache",
"Rate-Limit-60": "Unthrottled (0/60 requests) in 60 sec window",
"Rate-Limit-60-Status": "Unthrottled",
"Rate-Limit-60-Window": "60",
"Rate-Limit-60-RequestCount": "0",
"Rate-Limit-60-RequestLimit": "60",
"Cache-Control": "no-cache",
"Date": "Mon, 20 Feb 2023 11:32:52 GMT",
"Server": "Microsoft-IIS/10.0",
"X-AspNet-Version": "4.0.30319",
"X-Powered-By": "ASP.NET",
"Content-Length": "17782",
"Content-Type": "application/json; charset=utf-8",
"Expires": "-1"
},
"effectiveIntegrationRuntime": "AutoResolveIntegrationRuntime (West Europe)",
"executionDuration": 0,
"durationInQueue": {
"integrationRuntimeQueue": 0
},
"billingReference": {
"activityType": "ExternalActivity",
"billableDuration": [
{
"meterType": "AzureIR",
"duration": 0.016666666666666666,
"unit": "Hours"
}
]
}
}
When I Used COPY activities(created REST DS and Linked service), I got below issue, I am assuming this is because of \
.
Can someone please help me,
\
in response of WEB activity output?Url
of Response?
As in this output, How do I parse Url
to capture /api/Datab/abc
and /api/Datab/def
I tried to reproduce the similar issue and got similar response with extra slash(\)
Then I took set variable activity and created array variable with name demo
and converted it into Json format.
@json(activity('Web1').output.Response)
this will give you correct format of array.
Then pass this array variable to Foreach activity as below.
To access Url from this variable in foreach activity use @item().Url
OUTPUT