odata API $count deserializing issue in azure synapse copy activity

110 Views Asked by At

I am trying to get count from API call where I used /$count keyword. I want to capture this count for further validation and using copy activity. But unfortunately I am getting the following issue.

Error occurred when deserializing source JSON file ''. Check if the data is in valid JSON object format.

Any help is appreciated

Thanks rest api response Copy error output

Linked service for rest api

Web activity config Error Message

1

There are 1 best solutions below

13
Aswin On

Based on the screenshot provided, the issue is in the response of the API. It has a scalar value 20. But copy activity source dataset, expects a Json data or table format data. It should have key and value (column name and value). Only then, data can be copied to sink dataset. You can use web activity in ADF to get the API's value and use it in further activities in ADF.

enter image description here

Output of Web activity Output:

{
    "Response": "20",
    "ADFWebActivityResponseHeaders": {
        ........
        }
}

You can use the expression @activity('Web1').output.Response in the further activities in data factory to validate it.