检查逻辑应用 HTTP 请求中是否存在查询字符串

One*_*eil 2 parameters azure azure-logic-apps

如何检查逻辑应用 HTTP 请求中是否存在查询字符串?我知道如何获取该值(如果存在),triggerOutputs()['queries']['name']但不确定如何检查其 null 作为参数是否可选

小智 5

你必须使用?运算符,例如:

trigger().outputs?.queries?.name
Run Code Online (Sandbox Code Playgroud)

另外,如果您想获取其他值(如果名称为空),您可以使用合并:

@coalesce(trigger().outputs?.queries?.name, 'my t value instead of name') 
Run Code Online (Sandbox Code Playgroud)