简体   繁体   English

如何在逻辑应用程序中使用 HTTP 请求中传递的值/动态分配值给逻辑应用程序参数

[英]How to use values passed in HTTP Request in Logic Apps / Assign Values to Logic App Parameters Dynamically

I am trying to make a generic Logic App(LA) to do some processing on some files.我正在尝试制作一个通用的逻辑应用程序 (LA) 来对某些文件进行一些处理。 Calling the Logic App from ADF and able to pass the correct File Names.从 ADF 调用逻辑应用程序并能够传递正确的文件名。 However I am not able to use/assign values passed to the Logic App to the parameters defined in the LA.但是,我无法将传递给逻辑应用程序的值使用/分配给 LA 中定义的参数。 What am I Missing?我错过了什么? Please see the screenshot.请看截图。

-Thanks -谢谢

在此处输入图像描述

Sample Execution to show the names are passed properly.示例执行以显示名称已正确传递。

在此处输入图像描述

As far as I know, we can't assign PRM_FileName from the body of the request to one parameter.据我所知,我们无法将请求正文中的PRM_FileName分配给一个参数。 But we can use expression to get the value of PRM_FileName .但是我们可以使用表达式来获取PRM_FileName的值。

The expression should be triggerBody()?['PRM_FileName'] .表达式应为triggerBody()?['PRM_FileName'] You can also assign PRM_FileName to a variable (for example named var1 ) and you can use the var1 in your next actions but not use the expression(shown as below screenshot).您还可以将PRM_FileName分配给一个变量(例如名为var1 ),您可以在接下来的操作中使用var1但不使用表达式(如下图所示)。 在此处输入图像描述

============================ Update =========================== ============================更新===================== ======

Below is my logic app:下面是我的逻辑应用程序:

在此处输入图像描述

I did everything what you mentioned in your 3 steps except I put the PRM_FileName in the body of the request but not appending it at the end of url.除了我将PRM_FileName放在请求的正文中但没有将其附加在 url 的末尾之外,我做了您在 3 个步骤中提到的所有内容。

在此处输入图像描述

============================ Update 2 =========================== ============================更新 2 ==================== =======

Please use same schema with mine:请使用与我相同的模式:

{
    "type": "object",
    "properties": {
        "PRM_FileName": {
            "type": "string"
        }
    }
}

And then select the PRM_FileName into the variable directly(shown as below screenshot).然后直接将PRM_FileName写入变量中(如下截图所示)。 在此处输入图像描述

The expression should be triggerBody()?['PRM_FileName'] , but in your screenshot the expression is triggerOutputs()['queries']['PRM_FileName'] .表达式应为triggerBody()?['PRM_FileName'] ,但在您的屏幕截图中,表达式为triggerOutputs()['queries']['PRM_FileName']

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

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