Azure 液体模板-项目ID
有人可以帮助我如何使用液体模板从下面提取itemid吗Azure 液体模板-项目ID,azure,liquid,azure-logic-apps,dotliquid,Azure,Liquid,Azure Logic Apps,Dotliquid,有人可以帮助我如何使用液体模板从下面提取itemid吗 { "orders": [ { "id": 3688882438313, "line_items": [ { "id": 9698678243497 }, { "id": 9698678276265
{
"orders": [
{
"id": 3688882438313,
"line_items": [
{
"id": 9698678243497
},
{
"id": 9698678276265
}
]
}
]
}
I can get the order id from the following template:
{
"Order" : [
{% for order in content.orders%}
{
"ID" : "{{ order.id }}",
},
{% endfor %}
]
}
但无论我如何尝试,似乎都无法提取项目ID,建议将不胜感激。根据您的要求,这里提供一份液体样品供您参考:
{
"Order" : [
{% for order in content.orders%}
{
"ID" : "{{ order.id }}",
"ItemIds": [
{% for item in order.line_items%}
{
"itemId": "{{item.id}}"
},
{% endfor %}
]
},
{% endfor %}
]
}
运行上面的液体,我们可以得到结果:
{
"Order": [
{
"ID": "3688882438313",
"ItemIds": [
{
"itemId": "9698678243497"
},
{
"itemId": "9698678276265"
}
]
}
]
}
我提供了一个液体样本以获取itemId供您参考,如果您想要其他json格式的itemId,请让我知道并提供您想要的格式样本。嗨,这篇文章有任何更新吗?非常感谢。工作是一种享受。我现在遇到的问题是试图包含一个if或筛选器。如果您原来的问题已解决,请您将我的答案标记为“已接受”,谢谢。对于您的新问题,请提供更多详细信息,说明您希望如何包含“如果”或“过滤器”?您希望通过包含“if”或“filter”来实现什么?然后我会继续帮你解决。非常感谢。