In my flow, I have a date calculation to subtract 8hours from current time like below.
addHours(utcNow(),-8,'yyyy-MM-ddThh:mm:ss')
I want to take this parameter value(8) from a variable. I have set an integer variable with value 8. so, new expression is like
addHours(utcNow(),-variables('varHours'),'yyyy-MM-ddThh:mm:ss').
But this expression is throwing error invalid expression.
please help?
Thanks @michael0808 , it works.
This is where you're going wrong addHours(utcNow(),-variables('varHours'),'yyyy-MM-ddThh:mm:ss')
Expressions don't work in this fasion. In order to get the negative of an integer, you can multiply by -1.
Try this:
addHours(utcNow(),mul(variables('varHours'), -1),'yyyy-MM-ddThh:mm:ss')