Hi,
I use a stored procedure in MSSQL with an Output-Parameter. When I start this SP in SQL-Management Studio I receive an integer value as output. Ok, it works fine.
When I use this SP in Power Apps Flows, the result what i get is NULL. Here is the Outputs:
{ "statusCode": 200, "headers": { "Pragma": "no-cache", "Transfer-Encoding": "chunked", "Vary": "Accept-Encoding", "x-ms-request-id": "035bc1ef-23d3-487c-bb58-61ee00130807", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "DENY", "Timing-Allow-Origin": "*", "x-ms-apihub-cached-response": "true", "Cache-Control": "no-store, no-cache", "Date": "Mon, 01 Mar 2021 08:47:42 GMT", "Content-Type": "application/json; charset=utf-8; odata.metadata=minimal", "Expires": "-1", "Content-Length": "39" }, "body": { "ResultSets": {}, "OutputParameters": {} } }
I think the place of the MSSQL-Result is in the body/ResultSets, correct?
What can I do here?
Thanks
Torsten
Hi @ManishJain
sorry for my late reply...
I've changed now the SP with a select statement. Here is the Code:
ALTER PROCEDURE [dbo].[Check_existing_WH]
-- Add the parameters for the stored procedure here
@pCompany int = 0,
@pSite int = 0,
@pMonth varchar(10) = 'Jan',
@pYear int = 0,
@return int OUT
AS
BEGIN
SET NOCOUNT ON;
if not exists (SELECT WH_Employee from [dbo].[tbl_Working_Hours] where Company = @pCompany AND Site = @pSite AND Month = @pMonth AND Year = @pYear)
Begin
select @return = 0
End
Else
Begin
select @return = 1
End
END
In MSSQL I get a result (1 or 0). This procedure works fine.
When I use this SP in Power Apps, I don't get a return value. In the body-area I get this:
{
"ResultSets": {},
"OutputParameters": {}
}
What is my problem here???
Regards
Torsten