You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Canvas应用连接本地SQL时遇Patch/SubmitForm记录未找到错误

问题:Canvas应用连接本地SQL Server提交数据失败
  • 已搭建连接本地SQL Server网关的Canvas应用,连接验证成功,可通过数据表预览查看全部记录
  • 在数据表下方设置按钮,点击后可导航至编辑屏幕,编辑表单能成功预加载选中记录的所有数据
  • 使用SubmitForm(form)函数提交表单时,触发错误:

使用Patch函数时出现网络错误:未找到指定记录。

  • 尝试将提交逻辑替换为Patch函数,示例代码:
Patch(OnPremiseSQLDB,dt_DataTable.Selected,
{Notes: DataCardValue46.Text});

替换后仍报相同错误,排查2小时无果,开启应用监控后获取以下日志:

监控日志

1. Network - patchRow - Error - Not Found

{
  "status": 404,
  "duration": 74.39,
  "dataSource": "OnPremiseSQLDB",
  "responseSize": 54,
  "controlName": "btn_FormSave",
  "propertyName": "OnSelect",
  "nodeId": 7,
  "formulaData": {
    "script": "Patch(OnPremiseSQLDB,dt_DataTable.Selected,\r\n{Notes: DataCardValue46.Text})",
    "spanStart": 0,
    "spanEnd": 74
  },
  "data": {
    "context": {
      "entityName": "btn_FormSave",
      "propertyName": "OnSelect",
      "id": 13538,
      "nodeId": 7,
      "diagnosticContext": {
        "span": {
          "start": 0,
          "end": 74
        },
        "dataOperation": {
          "protocol": "cdp",
          "operation": "patchRow",
          "apiId": "/providers/microsoft.powerapps/apis/shared_sql",
          "dataSource": "UT_IVCustom",
          "table": "[dbo].[UT_IVCustom]",
          "operationName": "CdpConnector.patchRowAsync"
        },
        "formula": "Patch(OnPremiseSQLDB,dt_DataTable.Selected,\r\n{Notes: DataCardValue46.Text})"
      }
    }
}

2. Function - Patch - Error -

{
  "status": null,
  "duration": null,
  "dataSource": null,
  "responseSize": null,
  "controlName": "btn_UT_IVCustomSave",
  "propertyName": "OnSelect",
  "nodeId": 7,
  "formulaData": {
    "script": "Patch(OnPremiseSQLDB,dt_DataTable.Selected,\r\n{Notes: DataCardValue46.Text})",
    "spanStart": 0,
    "spanEnd": 74
  },
  "data": {
    "errorMessage": "Network error when using Patch function: The specified record was not found.",
    "raiseToastNotification": false,
    "wasReported": false,
    "functionName": "Patch",
    "context": {
      "entityName": "btn_FormSavee",
      "propertyName": "OnSelect",
      "id": 13538,
      "nodeId": 7,
      "diagnosticContext": {
        "span": {
          "start": 0,
          "end": 74
        },
        "formula": "Patch(OnPremiseSQLDB,dt_DataTable.Selected,\r\n{Notes: DataCardValue46.Text})"
      }
    },
    "info": "Network error when using Patch function: The specified record was not found."
  }
}

内容的提问来源于stack exchange,提问作者RAM

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.26 23:55:18