cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kyleatetain
Regular Visitor

Checking if a variable contains data

Hi Everyone,

 

I'm trying to check whether an approver has included comments in an Approval and have initialised a variable 'FormComments' at the beginning of the flow, then I've set the variable to the comments inside the approved condition.  However, how do I check if the FormComments actually has data?  I was trying

 

if(empty(variables('FormComments')),'', 'Their comments were 'variables('FormComments'))
 
However, that didn't work.. any suggestions are appreciated.
 
 
1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: Checking if a variable contains data

Hi @kyleatetain,

 

Do you want to send an email with the comments in the body?

 

If yes, you could try the following code:

if(empty(variables('Comments')),'',variables('Comments'))

 

I have made a test with this flow and it works as expected.

1.PNG 

 

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
kyleatetain
Regular Visitor

Re: Checking if a variable contains data

Capture.PNG

Community Support
Community Support

Re: Checking if a variable contains data

Hi @kyleatetain,

 

Do you want to send an email with the comments in the body?

 

If yes, you could try the following code:

if(empty(variables('Comments')),'',variables('Comments'))

 

I have made a test with this flow and it works as expected.

1.PNG 

 

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Administrator
Administrator

Re: Checking if a variable contains data

Hey, @kyleatetain!

 

Thank you for posting on the Flow Community Forum! It appears as though @v-yamao-msft would like some more information in order to further assist you properly with your issue. Please share any additional information that was requested in order to decrease the amount of time that it will take for you to be assisted!

 

Thank you for being an active member of the Flow Community!

 

-Gabriel
Flow Community Manager

-Gabriel
Microsoft Power Automate Community Manager
Are YOU a member of your local Power Automate User Group?
Fill out This Form to claim your Community User Group Member Badge!
kyleatetain
Regular Visitor

Re: Checking if a variable contains data

Thank you!

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

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

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (6,973)