cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Approval Flow Fails If Comments Are Empty

I have created a flow that has approval requests in them.

 

Inside the flow is a condition that if the first line of approvals contains the name of a senior manager here it will trigger another approval run that requires him to approve the new entry of the spreadsheet. The idea is that if those comments don't contain that name or are empty then it should run the 'no' arm of the condition.

 

Unfortunately if the comments are empty the condition fails and causes the no arm (and therefore the remainder of the flow) to fail. If, however, you put ANYTHING in the comments then the flow will continue.

 

Ideally I would like it so the comments can be left blank if necessary.

 

Does anyone have any tips please?

6 REPLIES 6
Super User
Super User

Re: Approval Flow Fails If Comments Are Empty

Can you upload a screen shot of the run history failing?

Anonymous
Not applicable

Re: Approval Flow Fails If Comments Are Empty

Hi Pieter, 

 

I've tried to upload the photo here but must be some issue with our security settings. I've uploaded them to google drives so please feel free to have a look. 

 

I've included the failure report as well as some images of the flow itself. 

 

Gallery of flow images

Super User
Super User

Re: Approval Flow Fails If Comments Are Empty

I've not fully tested it, but I think I undertsna the problem.

 

The contition is checking 

 

null contains xyz

 

this is not valid.

 

Can you put the comment in a coalesce function

 

coalesce(<Your dynamic content>,'unknown')  

 

this will set the left hand side of the condition to unknown if the dynamic content is empty.

 

Anonymous
Not applicable

Re: Approval Flow Fails If Comments Are Empty

Hi Pieter,

 

It should be testing like this (I've put it in to a bit of code to see if that helps)

 

if (approval response comments = 'Simon') {

     send approval request to recipient 'Simon'

           if (simon response = approve) {

                run apply to each 3

                    }

              }

else {

run apply to each 4

}

 

This is what I was hoping the condition would do. It does do this but only if there's any kind of comment in the initial responses.

 

With that in mind would your intial suggestion still work?

 

 

 

 

 

Super User
Super User

Re: Approval Flow Fails If Comments Are Empty

In your above logic, it looks like 

 

 if (simon response = approve) { ...

 

is compairing the invalid stuff. So you will need to include the coalesce here. 

 

So somthing like this:

coalesce(simon response, 'unknown') = 'approve'

 

If somin's response is now empty you will get 'unknown' = 'approve' being returened as false. When the response is not empty you will get the response being compared with approve.

Anonymous
Not applicable

Re: Approval Flow Fails If Comments Are Empty

Ah I understand where we have our wires crossed.

 

The part of the flow you're referring to works.

 

The bit that doesn't work is the condition above it which should be

 

if the initial approval comments contains the word 'Simon' then run the yes arm. If it contains null or anything else then run the no arm.

 

Once it gets to Simon it works every time!

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Coming Soon: T-shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Top Solution Authors
Top Kudoed Authors
Users online (6,067)