web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Error when trying to u...
Power Apps
Suggested Answer

Error when trying to use Stored Procedures

(2) ShareShare
ReportReport
Posted on by 6
I have a stored procedure that populates a collection when clicking a button after selecting some options from dropdowns that are used as params - I have tried it in design and it all works fine but once I publish and let my users try it I get this error:- 
 
SQLServer.dboGetLabourForShift failed: { "error": { "code": 400, "message": "Error validating Execution Restrictions - Bad URL", "source": "df0c900a-77ac-49a6-b0f7-2ebe7ee0b5f3.10.common.uk.azure-apihub.net", "path": "choose[3]\\when[1]\\choose\\when[2]", "policyId": "", "clientRequestId": "3ad3562a-b4b9-44e8-92bd-f6fc43157e94", "dreeSet": "true" } }
 
Anyone have any ideas?
Thanks
Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,969 Moderator on at
     
    1. Have you made sure they have execute permissions? and that anything the Sp needs to access (data, files, folders, whatever they have access to)
     
    2. I would do the following 
    1. Have a user do a screen share
    2. Have them go to powerapps.com
    3. Go to the Apps Tab (left menu click)
    4. Go to your App line and click the vertical … , then click Details => Live Monitor
    5. Once it loads , click the Play published App (it will open a new tab)
    6. Click to that tab to run the app
    7. Have the user cause the error (leave tab open)
    8. Click back to the Live Monitor
    9. Top right corner, click Filter, type Error
    Now it will filter and find only lines with Error in it
    The issue is a single error will cause 1-Many lines
    So please do this
    • Click each line starting at the top
      • On the first one, immediately click and open the Properties collapsed window (it says properties vertically on the right)
    • Once you get to a line that causes that window to have 4 tabs
      • The 4rth tab, will say Response
      • Then click the Body part of the json (which is collapsed) to see more details about the error
    Free free to paste it here, if it doesn’t help you. If it does please mark this as the answer.

     
  • AG-11031425-0 Profile Picture
    6 on at
    HI - thanks for you response
     
    I have logged onto SQL server using the apps credentials and it can execute the stored procs
     
    I have opened the Live monitor and it is showing basically the same as the initial error message - as follows:-
     
     "body": {
        "error": {
          "code": 400,
          "message": "Error validating Execution Restrictions - Bad URL",
          "source": "d72a7533-93b5-45af-bef4-ffa8056484c5.05.common.uk.azure-apihub.net",
          "path": "choose[3]\\when[1]\\choose\\when[2]",
          "policyId": "",
          "clientRequestId": "686cf8a4-4aa3-4c89-8255-08537a125605",
          "dreeSet": true
        }
     
  • AG-11031425-0 Profile Picture
    6 on at
    Sorry about the delay in getting back, this is from the Live Monitor:-
     

    {

      "status": 400,

      "duration": 0,

      "dataSource": "SQLServer",

      "responseSize": 0,

      "controlName": "btnSearch",

      "propertyName": "OnSelect",

      "nodeId": 19,

      "formulaData": {

        "script": "",

        "spanStart": null,

        "spanEnd": null

      },

      "data": {

        "context": {

          "entityName": "btnSearch",

          "propertyName": "OnSelect",

          "nodeId": 19,

          "id": 26938,

          "diagnosticContext": {

            "dataOperation": {

              "protocol": "rest",

              "operation": "dboGetLabourForShift",

              "dataSource": "SQLServer"

            }

          }

        },

        "request": {

          "url": "https://df0c900a-77ac-49a6-b0f7-2ebe7ee0b5f3.10.common.uk.azure-apihub.net/apim/sql/8237df52-03bc-496b-87a4-0e7378115b28/v2/datasets/default,default/procedures/dbo.GetLabourForShift",

          "method": "POST",

          "headers": {

            "x-ms-pa-client-telemetry-options": "paclient-telemetry {\"operationName\":\"/providers/microsoft.powerapps/apis/shared_sql.dboGetLabourForShift\"}",

            "ServiceNamespace": "SQLServer",

            "x-ms-shared-connection-id": "4ebaec2fffbf43009268676677a6415a",

            "Content-Type": "application/json"

          },

          "body": {

            "Depot": 2,

            "Shift": 2,

            "ShiftDate": "2025-03-05",

            "Supervisor": 683

          }

        },

        "response": {

          "duration": 0,

          "size": 0,

          "status": 400,

          "headers": {

            "Content-Length": 355,

            "Content-Type": "application/json",

            "x-ms-dlp-gu": "-|-",

            "x-ms-dlp-re": "-|-",

            "x-ms-environment-id": "df0c900a-77ac-49a6-b0f7-2ebe7ee0b5f3",

            "x-ms-tenant-id": "87c38de1-7677-4ae8-b543-17ff79c50890",

            "x-ms-client-request-id": "ecfae9bd-d451-4a55-bebf-a22d6444492f"

          },

          "body": {

            "error": {

              "code": 400,

              "message": "Error validating Execution Restrictions - Bad URL",

              "source": "df0c900a-77ac-49a6-b0f7-2ebe7ee0b5f3.10.common.uk.azure-apihub.net",

              "path": "choose[3]\\when[1]\\choose\\when[2]",

              "policyId": "",

              "clientRequestId": "ecfae9bd-d451-4a55-bebf-a22d6444492f",

              "dreeSet": true

            }

          },

          "responseType": "text"

        }

      }

    }

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard