从逻辑应用中的SQL JSON提取值

发布于 01-22 14:30 字数 667 浏览 2 评论 0原文

在逻辑应用中,我有一个针对提取SQL行的每个循环。 我想要我的输出-SP1'B506-1B205DB6DCD3'。

现在写,我可以得到 - “ value”:“ {” name“:” sp1“}'b506-1b205db6dcd3'”。

如何从上述SQL输出 - 仅S​​P1获取名称值?

  "For_each": {
    "actions": {
      "Append_to_array_variable": {
        "inputs": {
          "name": "sp_name",
          "value": "@concat(items('For_each'),'''',outputs('Compose'),'''')"
        },
        "runAfter": {},
        "type": "AppendToArrayVariable"
      }
  }

目前,输出正在遵循

    {
        "name": "sp_name",
        "value": "{\"NAME\":\"SP1\"}'b506-1b205db6dcd3'"
    }
  

我希望从@concat(项目('for_each')中的值-sp1与另一个变量concat。

In logic app , I have a for each loop which extract the SQL rows.
I want my output - SP1'b506-1b205db6dcd3'.

Write now I am able to get - "value": "{"NAME":"SP1"}'b506-1b205db6dcd3'".

How can I get value of Name from the above SQL output - SP1 only?

  "For_each": {
    "actions": {
      "Append_to_array_variable": {
        "inputs": {
          "name": "sp_name",
          "value": "@concat(items('For_each'),'''',outputs('Compose'),'''')"
        },
        "runAfter": {},
        "type": "AppendToArrayVariable"
      }
  }

Right now output is following

    {
        "name": "sp_name",
        "value": "{\"NAME\":\"SP1\"}'b506-1b205db6dcd3'"
    }
  

I want value - SP1 from @concat(items('For_each') to concat with another variable.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

吐个泡泡 2025-01-29 14:30:37

我只是注意到有“结果”名称为执行SQL查询的输出,该输出为我提供了值。

I just noticed that there was 'Resultsets Name' as output of the execute sql query which is providing me that value.Regards.

远山浅 2025-01-29 14:30:37

现在写,我能够得到 - “ value”:“ {” name“:” sp1“}'b506-1b205db6dcd3'。

考虑“ value”:“ {”名称“:” sp1“}'b506-1b205db6dcd3'”您可以使用以下表达式使用slice()来检索值{“ name”:“ sp1”}的值。

slice(variables('var'),nthIndexOf(variables('var'),'{',2),add(nthIndexOf(variables('var'),'}',1),1))

然后,我们可以使用parse json作为该特定表达式,并拔出name值“ sp1”。这是我的逻辑应用程序

​> “在此处输入图像说明”

Write now I am able to get - "value": "{"NAME":"SP1"}'b506-1b205db6dcd3'".

Considering "value": "{"NAME":"SP1"}'b506-1b205db6dcd3'" you can use slice() just to retrieve the value {"NAME":"SP1"} using the below expression.

slice(variables('var'),nthIndexOf(variables('var'),'{',2),add(nthIndexOf(variables('var'),'}',1),1))

and then we can use Parse JSON for that particular expression and pull out the NAME value "SP1". Here is the flow of my logic app

enter image description here

RESULTS:

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文