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

MS Flow IF statement

Hi All,

I am new to MS Flow and I am having issues with the syntax of the If expression. The scenario is as follows:

  1. I am making use of the Add a row into a table Action.
  2. I have 2 fields named Cost Element and Posting Key.
  3. If the Cost Element field is not blank I want to set the Posting Key to 40, else the Posting Key should be blank.

Is the IF statement the correct way to go about this? If so what will the correct syntax be?

Thanks in advance for your help.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @MV23,

 

Do you want to update the value of field Posting Key based on whether the field Cost Element is empty or not?

I have made the following test, please check it for a reference.

It is triggered by When an item is created.

Add a row into a table. Select dynamic content Title for the field CostElement.

Then update a row to update the PostingKey using the following code:

if(not(empty(body('Add_a_row_into_a_table')?['CostElement'])),40,'')

Image for your reference:

1.PNG

 

Best regards,

Mabel

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

1 REPLY 1
Community Support
Community Support

Hi @MV23,

 

Do you want to update the value of field Posting Key based on whether the field Cost Element is empty or not?

I have made the following test, please check it for a reference.

It is triggered by When an item is created.

Add a row into a table. Select dynamic content Title for the field CostElement.

Then update a row to update the PostingKey using the following code:

if(not(empty(body('Add_a_row_into_a_table')?['CostElement'])),40,'')

Image for your reference:

1.PNG

 

Best regards,

Mabel

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

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (5,289)