Hi i'm new to the microsoft flow is there i way to make comments mandatory while approving or rejecting, right now i'm getting the comments as optional.If its possible to make it mandatory it will helpful if you give me a link or something which shows how its done.
Thanks in advance.
I don't think that there is a way to do this at the moment. You could create a new approval task and use a do-until the comment is filled in.
Hi @Nisarahmed,
Do you want to force users entering comments while approving or rejecting an approval email?
I agree with @Pieter_Veenstra's thought almost, if you want to enforce users entering comments while approving or rejecting an approval email directly, I afraid that there is no way to achieve your needs. If you would like this feature to be added in Microsoft Flow, please submit an idea to Flow Ideas Forum:
https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas
In addition, you could consider take a try with the following workaround as an alternative solution:
@empty(body('Start_an_approval')?['comments'])
@not(empty(body('Start_an_approval_2')?['comments']))
Within "Do Until" action, add a "Send an email" action, To field set to Approver email dynamic content of the "Start an approval" action. Then add a "Start an approval 2" action, specify Assigned to field.
Image reference:
The flow works successfully as below:
The user @lreinhard7 has faced same issue with you, please check the following thread:
Best regards,
Kris
If anyone else was struggling with this while using the "Stop and wait for an approval" action, make sure to set "Approval Type" to "Approve/Reject - First to respond".
If your workflow requires "Everyone must approve" then you will need to append comment to a string and have the Do Until loop check its length in order to achieve this workaround.
The reason is, each reponse's comments are stored in an array. So you can't just check
@not(empty(body('Start_and_wait_for_an_approval')?['comments']))
Also, you can get rid of the second check and just use one Do Until loop. Makes it a bit cleaner.
Hi,
Is it possible that comment is only mandatory for Reject and not for Approve?
and hence the reason of Rejection will send an email for action.
Yes, that's how mine is setup. You can adjust the do until logic to check also for Response is Approve or Response is Reject and Comment is not null. Again keep in mind this if for "First to approve". You will still have to append responses to an array and check length for parallel approvals.
@or(
equals(body('Start_and_wait_for_an_approval')?['response'], 'Approve'),
and(
equals(body('Start_and_wait_for_an_approval')?['response'], 'Reject'),
not(empty(body('Start_and_wait_for_an_approval')?['comments'])
)
)
User | Count |
---|---|
38 | |
35 | |
15 | |
13 | |
11 |
User | Count |
---|---|
23 | |
20 | |
18 | |
13 | |
13 |