I created a test action to make it clear what is my problem, of course my original logic app is much more complicated. The execute sql query action below returns the following error. Imo this is a SQL connector bug, because it should convert json null value to corresponding DBNull value (see this for example: https://stackoverflow.com/a/26242939).
Is it possible to fix this bug?
The error message:
{
"error": {
"code": 502,
"source": "logic-apis-westeurope.azure-apim.net",
"clientRequestId": "e7b89909-3d96-46f2-83a6-695523e7b1a5",
"message": "BadGateway",
"innerError": {
"status": 502,
"message": "The parameterized query '(@Param2 nvarchar(4000))select @Param2' expects the parameter '@Param2', which was not supplied.\r\nclientRequestId: e7b89909-3d96-46f2-83a6-695523e7b1a5",
"error": {
"message": "The parameterized query '(@Param2 nvarchar(4000))select @Param2' expects the parameter '@Param2', which was not supplied."
},
"source": "sql-we.azconn-we.p.azurewebsites.net"
}
}
}
The execute sql query action:
"TestDBNullAction": {
"inputs": {
"body": {
"actualParameters": {
"Param2": null
},
"formalParameters": {
"Param2": "int"
},
"query": "select @Param2"
},
"host": {
"connection": {
"name": "@parameters('$connections')['sql']['connectionId']"
}
},
"method": "post",
"path": "/v2/datasets/@{encodeURIComponent(encodeURIComponent('default'))},@{encodeURIComponent(encodeURIComponent('default'))}/query/sql"
},
"runAfter": {},
"type": "ApiConnection"
},
Thanks