逻辑应用程序将JSON数组中的数据转换为变量
我正在创建一个具有Azure函数的Azure Logic应用程序,该应用程序返回以下JSON
{
"Status": "Ok",
"Message": null,
"Response": {
"total": 1,
"data": [
{
"employeeID": "123456",
"userName": "John.Doe",
"fullName": "John Doe",
"legalFirstName": "John",
"legalLastName": "Doe"
}
]
}
}
我正在尝试将JSON数据转换为变量,以便能够在Azure Workflow的后续步骤中使用它们。
为此,我添加了一步以解析JSON,然后初始化一个变量。 当我添加一个值时,逻辑应用程序将初始化变量步骤嵌入到每个循环中的A中。我猜是因为返回的JSON数据在数组中。
但是,当保存逻辑应用程序以下错误时:“无法保存逻辑应用程序。 >
如何将JSON数据转换为变量?
I'm creating a Azure Logic App with a Azure function that returns the following JSON
{
"Status": "Ok",
"Message": null,
"Response": {
"total": 1,
"data": [
{
"employeeID": "123456",
"userName": "John.Doe",
"fullName": "John Doe",
"legalFirstName": "John",
"legalLastName": "Doe"
}
]
}
}
I'm trying to convert the JSON data to variables to be able to use these in follow-up steps of the Azure Workflow.
For this I added I step to parse the JSON and then initialize a variable.
When I add one of the values the Logic Apps embeds the initialize variable step into a for each loop which. I guess because the JSON data returned is in a array.
However, when saving the Logic App following error is returned: "Failed to save logic app RenameTest. The variable action 'Initialize_variable' of type 'InitializeVariable' cannot be nested in an action of type 'For_each'."
How can I convert the JSON data to variables?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看文档:
因此,您需要在流程开始时创建变量。然后,您可以使用设置变量循环内部的操作将变量分配给所需值。
Looking at the documentation:
So you would need to create the variables at the beginning of the flow. You can then use the Set variable action inside the loop to assign the variables to the desired values.