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

What is wrong with this If expression?

 

if(body('Get_record_(Preview)_2')?['internalemailaddress']='peter@peter.com','360667578072','1')

I want to achieve that if the dynamic tag 'internalemailaddress' equals peter@peter.com then return 360667578072 else return 1

 

I get the message that it is invalid..

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Support
Community Support

Re: What is wrong with this If expression?

Hi @pepep,

 

Could you please share a screenshot of your flow's configuration?

 

I think there is something wrong with the formula that you provided. The "=" operator is not supported within the expressions (WDL expression) of Microsoft Flow currently.

 

Please take a try to modify your formula into the following formula:

if(equals(body('Get_record_(Preview)_2')?['internalemailaddress'],'peter@peter.com'),'360667578072','1')

More details about using expressions within flow actions, please check the following formula:

Use expression in flow actions

 

More details about the WDL expression within Microsoft Flow, please check the following article:

https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
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

Highlighted
Regular Visitor

Re: What is wrong with this If expression?

Hi @v-xida-msft,

 

Thank you so much! I've read the wiki on how to use the formula's and your suggestion did the trick.

 

Now extended it with a few more if-statements in the formula.

 

Lesson 1: read the f* manual 🙂

View solution in original post

4 REPLIES 4
Highlighted
Community Support
Community Support

Re: What is wrong with this If expression?

Hi @pepep,

 

Could you please share a screenshot of your flow's configuration?

 

I think there is something wrong with the formula that you provided. The "=" operator is not supported within the expressions (WDL expression) of Microsoft Flow currently.

 

Please take a try to modify your formula into the following formula:

if(equals(body('Get_record_(Preview)_2')?['internalemailaddress'],'peter@peter.com'),'360667578072','1')

More details about using expressions within flow actions, please check the following formula:

Use expression in flow actions

 

More details about the WDL expression within Microsoft Flow, please check the following article:

https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
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

Highlighted
Regular Visitor

Re: What is wrong with this If expression?

Hi @v-xida-msft,

 

Thank you so much! I've read the wiki on how to use the formula's and your suggestion did the trick.

 

Now extended it with a few more if-statements in the formula.

 

Lesson 1: read the f* manual 🙂

View solution in original post

Highlighted
Advocate I
Advocate I

Re: What is wrong with this If expression?

This is expression is invalid in my Flow:

If(true, "OK", "Not OK")
Used in a SharePoint "Update item" text box.
Highlighted
Frequent Visitor

Re: What is wrong with this If expression?

I'm sorry but it doesn't work with me.

 

if(equals(body('Obter_detalhes_da_resposta')?['Pergunta'],'10'), 'Yes''No')
or
if(equals(item()?['Pergunta'],'10'), 'Yes''No')
 
I get 'No' all the time.
I'm trying to get data from Forms.
Thanks.

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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!

Top Solution Authors
Top Kudoed Authors
Users online (8,890)