Logic Apps:如何从Http API cal获得display_value响应 [英] Logic Apps : How to get the display_value response from Http API cal
问题描述
在Azure Logic应用中,下面是我在进行Http响应调用时所获得的响应.
In Azure Logic app, the response I am getting while I am making an Http response call is below.
{
"import_set": "",
"staging_table": "",
"result": [
{
"transform_map": "",
"table": "incident",
"display_name": "",
"display_value": "INC5164816461631654",
"record_link": "",
"status": "",
"sys_id": ""
}
]
}
如何获取"display_name"属性.我尝试了
How I can get the 'display_name' property. I tried several ways like
@triggers().outputs.body.result.display_name
@{body('HTTP')['result'][display_name]}
但是它不起作用.
结果:INC5164816461631654
Result: INC5164816461631654
推荐答案
如果您的输出为json格式,则可以使用以下表达式获取它:@body('HTTP')['result'][0]['display_name']
.因为在标签result
下它是数组,所以如果您不指向索引,它将无法找到该属性.
If your output is in json format, you could just get it with a expression:@body('HTTP')['result'][0]['display_name']
. Cause under tag result
it's array, so if you don't point the index, it won't be able to find the property.
如果您的输出不是json格式,它将是一个字符串.您需要将其解析为json.
然后,您将可以使用相同的表达式(@body('Parse_JSON')['result'][0]['display_name']
)来获取值.
And if your output is not json format, it will be a string. you need to parse it to json.
Then you will be able to use same expression(@body('Parse_JSON')['result'][0]['display_name']
) to get the value.
这篇关于Logic Apps:如何从Http API cal获得display_value响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!