Hello, I am currently creating a flow that has two approvals requests, where the second one uses the comments submitted in the first approval request. My flow works fine if a comment is submitted, but fails if there is no comment as the array variable becomes "null". Is there a way to mitigate this?
Thank you!
error message:
Flow:
Thank you, this is exactly what I was looking for!
Hi @Anonymous
Pls check for null value using "Condition" action. If value is not null, then append the comments in the array variable as show below:
If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.
Thanks
Hi @Anonymous ,
Try this expression: if(empty(variables('response')?['comment']), '', variables('response')?['comment']), replacing the red text for the dynamic content of your comment.
It will append an empty text to your array when there is no comment in the approval. You can also change the empty for any other "default value" when there is no comment in the approval (for doing that, just change the second argument of the expression).
Let me know if it works for you or if you need any additional help!
-------------------------------------------------------------------------
If this is the answer for your question, please mark the post as Solved.
If this answer helps you in any way, please give it a like.
stampcoin
51
Michael E. Gernaey
39
Super User 2025 Season 1
Chriddle
21
Super User 2025 Season 1