cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
kyleatetain
Level: Powered On

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 Team
Community Support Team

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
Level: Powered On

Re: Checking if a variable contains data

Capture.PNG

Community Support Team
Community Support Team

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
Level: Powered On

Re: Checking if a variable contains data

Thank you!

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Speakers, submit your sessions now! Call for speakers ends Feb. 10!

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!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,697)