Skip to main content

Notifications

Power Automate - Using Flows
Unanswered

Flow with result from MSSQL-Stored procedure

(0) ShareShare
ReportReport
Posted on by 28

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

  • torsten156 Profile Picture
    torsten156 28 on at
    Re: Flow with result from MSSQL-Stored procedure

    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

  • MJain Profile Picture
    MJain 2,450 on at
    Re: Flow with result from MSSQL-Stored procedure

    HI @torsten156 ,

     

    In your Stored procedure return by putting select statement.

     

    Thanks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,475

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,767

Leaderboard

Featured topics

Restore a deleted flow