[英]Query a JSON object in Powerautomate
In Power Automate I have a JSON object like this (this is a small sample, the actual bigger):在 Power Automate 中,我有一个 JSON object 这样的(这是一个小样本,实际更大):
{
"items": [
{
"day": 1,
"month": 1,
"year": 2021,
"balance": 6
},
{
"day": 2,
"month": 1,
"year": 2021,
"balance": 47
}
]
}
Additionally, I have a variable with a specific day (myDay), I want to get the value of the balance for the day = myDay, how can I achieve this?此外,我有一个特定日期 (myDay) 的变量,我想获取当天的余额值 = myDay,我该如何实现?
What is the syntax to use instead of a fixed value (variables('myJson')?['items']?[1]?['balance'])?使用什么语法代替固定值(变量('myJson')?['items']?[1]?['balance'])?
Thanks,谢谢,
Considering the additional details in the comments, I think this expression should do the trick:考虑到评论中的其他细节,我认为这个表达式应该可以解决问题:
variables('myJson')?['items']?[sub(variables('myDay'), 1)]?['balance']
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.