admin管理员组文章数量:1336340
I have a problem with my flow in Power Automate. The flow is supposed to check if a row has been added to a table in Excel, and if so, it sends an email. Everything works well until a user adds an empty row where the ID number is not provided. I tried using the empty and coalesce functions, but I think I did it wrong. Please help. Below is the code
Error:Action 'IF_SP_LP_is_bigger_then_LP_from_excel' failed: Unable to process template language expressions for action 'IF_SP_LP_is_bigger_then_LP_from_excel' at line '0' and column '0': 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.
Code:
"type": "If",
"expression": {
"or": [
{
"greaterOrEquals": [
"@int(body('Get_item')?['Title'])",
"@int(coalesce(items('For_each_1')?['LP_x002e_'], '0'))"
]
},
{
"equals": [
"@empty('For_each_1')?['LP_x002e_']",
"@null"
]
}
]
},
I have a problem with my flow in Power Automate. The flow is supposed to check if a row has been added to a table in Excel, and if so, it sends an email. Everything works well until a user adds an empty row where the ID number is not provided. I tried using the empty and coalesce functions, but I think I did it wrong. Please help. Below is the code
Error:Action 'IF_SP_LP_is_bigger_then_LP_from_excel' failed: Unable to process template language expressions for action 'IF_SP_LP_is_bigger_then_LP_from_excel' at line '0' and column '0': 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.
Code:
"type": "If",
"expression": {
"or": [
{
"greaterOrEquals": [
"@int(body('Get_item')?['Title'])",
"@int(coalesce(items('For_each_1')?['LP_x002e_'], '0'))"
]
},
{
"equals": [
"@empty('For_each_1')?['LP_x002e_']",
"@null"
]
}
]
},
Share
Improve this question
asked Nov 20, 2024 at 6:20
SebastianSebastian
235 bronze badges
1
- I think I know why but you need to show us some data. Too hard to help given we can’t see the data that you’re processing at the time the error occurs. – Skin Commented Nov 20, 2024 at 7:08
1 Answer
Reset to default 0greaterOrEquals
(and other equaluity functions) expects non-null parameters. You can use the 'equals()
' like
equals(triggerOutputs('ID'),null)
and then nest the true and false conditions with further equality operators. The final expression would look something like this
if(
equals(triggerOutputs('ID'),null),
null, or '' (empty string) if you want to equate later
triggerOutputs('Name') // or any other field that you want to read.
)
本文标签: Automate Flow fails with empty row in tableStack Overflow
版权声明:本文标题:Automate Flow fails with empty row in table - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742377387a2463432.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论