简体   繁体   English

逻辑应用程序中的存储过程 Output 未成为动态内容

[英]Output of Stored Proc in Logic apps not becoming Dynamic content

I've made a Stored Proc and I've initialized it in a variable and am trying to make the output of the Stored Proc Dynamic content in Logic Apps, however.但是,我创建了一个存储过程并将其初始化为一个变量,并试图在逻辑应用程序中创建存储过程动态内容的 output。 Once I put the variable in the Parse JSON step, it will not become Dynamic.一旦我将变量放入 Parse JSON 步骤,它就不会变成 Dynamic。 Any advice on how to make my Stored Proc output Dynamic content?关于如何制作我的存储过程 output 动态内容的任何建议?

My output varies on the number of entries I'm able to retrieve and I think that's my issue.我的 output 因我能够检索的条目数而异,我认为这是我的问题。 I've set my Parse JSON scheme to look for 6 entries and sometimes I will get 8-10, which I believe is my problem How can I make it so that no matter how many entries come through from my Stored Proc, I can capture those values in dynamic content and use them?我已经将我的 Parse JSON 方案设置为查找 6 个条目,有时我会得到 8-10 个,我认为这是我的问题我怎样才能做到这一点,无论有多少条目来自我的存储过程,我都可以捕获动态内容中的那些值并使用它们?

在此处输入图像描述

在此处输入图像描述

I see that you are trying to check the SQL dynamic content rather than checking the Parse JSON Connector.我看到您正在尝试检查 SQL 动态内容,而不是检查 Parse JSON 连接器。 Make sure you are checking in the dynamic content of Parse JSON.确保您正在签入 Parse JSON 的动态内容。

在此处输入图像描述

Also, after reproducing from my end, I could able to get the expected results without using Parse Json too.此外,在从我这边复制之后,我也可以在不使用 Parse Json 的情况下获得预期的结果。

在此处输入图像描述

when you follow the above the process you can retrieve no matter how many entries are there in the table.当您按照上述过程进行操作时,无论表中有多少条目,您都可以检索。 Below is the complete flow that worked for me.以下是对我有用的完整流程。

在此处输入图像描述

Below is the schema of my logic app以下是我的逻辑应用程序的架构

{
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "actions": {
            "Execute_stored_procedure_(V2)": {
                "inputs": {
                    "host": {
                        "connection": {
                            "name": "@parameters('$connections')['sql']['connectionId']"
                        }
                    },
                    "method": "post",
                    "path": "/v2/datasets/@{encodeURIComponent(encodeURIComponent('default'))},@{encodeURIComponent(encodeURIComponent('default'))}/procedures/@{encodeURIComponent(encodeURIComponent('[dbo].[proc1]'))}"
                },
                "runAfter": {},
                "type": "ApiConnection"
            },
            "Parse_JSON": {
                "inputs": {
                    "content": "@body('Execute_stored_procedure_(V2)')",
                    "schema": {
                        "properties": {
                            "OutputParameters": {
                                "properties": {},
                                "type": "object"
                            },
                            "ResultSets": {
                                "properties": {
                                    "Table1": {
                                        "items": {
                                            "properties": {
                                                "firstname": {
                                                    "type": "string"
                                                },
                                                "lastname": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "firstname",
                                                "lastname"
                                            ],
                                            "type": "object"
                                        },
                                        "type": "array"
                                    }
                                },
                                "type": "object"
                            },
                            "ReturnCode": {
                                "type": "integer"
                            }
                        },
                        "type": "object"
                    }
                },
                "runAfter": {
                    "Execute_stored_procedure_(V2)": [
                        "Succeeded"
                    ]
                },
                "type": "ParseJson"
            }
        },
        "contentVersion": "1.0.0.0",
        "outputs": {},
        "parameters": {
            "$connections": {
                "defaultValue": {},
                "type": "Object"
            }
        },
        "triggers": {
            "manual": {
                "inputs": {
                    "schema": {}
                },
                "kind": "Http",
                "type": "Request"
            }
        }
    },
    "parameters": {
        "$connections": {
            "value": {
                "sql": {
                    "connectionId": "/subscriptions/xxxx/resourceGroups/xxxx/providers/Microsoft.Web/connections/sql",
                    "connectionName": "sql",
                    "id": "/subscriptions/xxxx/providers/Microsoft.Web/locations/eastus/managedApis/sql"
                }
            }
        }
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM