web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / (if) Condition do noth...
Power Automate
Answered

(if) Condition do nothing/ keep current value

(1) ShareShare
ReportReport
Posted on by 16

Hello everyone,

 

there have already been some discussions on how to build an if condition that does nothing when false. However those Solutions do not seem to work for my case. Maybe you have some ideas to help me with this:

The request seems to be quite simple: If a certain colum(Actiontype) as a defined value do some calculations and put them into an other colum (Sum1). The Actiontype defines which sum colums (sum1-4) have to be updated. The sum colums already have some calculated values. 

I am using the Dataverse Connector but anyways I though this should work: Solved: do nothing in if function - Power Platform Community (microsoft.com) 

If eq(Actiontype),2, calculate and update sum1, do nothing

 

if(equals(triggerBody()['number']),2,variables('SummeEtat'))
if(equals(triggerBody()['number']),2,variables('SummeEtat'),)
if(equals(triggerBody()['number']),2,variables('SummeEtat'),'')

 

which either is not recognizes as a valid expression or promts this error:

 

Unable to process template language expressions in action 'Update_Controlling_Position_Etat_ANF_Prod' inputs at line '0' and column '0': 'The template language function 'equals' expects two parameters: the values to test for deep equality. The function was invoked with '1' parameter(s). Please see https://aka.ms/logicexpressions#equals for usage details.'.

 

 I have tried puting the current value of the field into the false condition but since the current value comes from one apply to each container and the if condition is in another apply to each container I get another error that the first apply to each has to be superior to the second one which is understandable. 

So maybe anyone has another idea on how to form an expression that updates a value if true and simply does nothing to the existing value if false. 

 

Thank you in advance

Categories:
I have the same question (0)
  • tom_riha Profile Picture
    10,187 Most Valuable Professional on at

    Hello @TimFe ,

    I'd try two ideas:

    1. use null value

    if(equals(triggerBody()['number']),2,variables('SummeEtat'),null)

    2. keep the original value

    if(equals(triggerBody()['number']),2,variables('SummeEtat'),<the current value>)
    
    e.g.
    if(equals(triggerBody()['number']),2,variables('SummeEtat'),triggerBody()['number'])

     

  • Verified answer
    eliotcole Profile Picture
    4,390 Moderator on at

    It is failing because your equals() functions are a little bit off, @TimFe, if you don't mind me saying.

     

    This is what you currently have in that first if() statement, and I've fanned it out so you can see:

    if(
     equals(
     triggerBody()['number']
     ),
     2,
     variables('SummeEtat')
    )

    What you have there is an equals statement without its second parameter. Your other two are similarly (but not the same) just a little off (I've fanned them in the below spoiler):

     

    Spoiler (Highlight to read)
    If #2 also has a bad equals, but the end of the if has an extra comma which infers more should be there:
    if(
     equals(
     triggerBody()['number']
     ),
     2,
     variables('SummeEtat'),
    )
    If #3 is perhaps probably closest to what you're after, here, you wish it to be empty or null on the false branch.

    It just still has the bad equals 😉:
    if(
     equals(
     triggerBody()['number']
     ),
     2,
     variables('SummeEtat'),
     ''
    )
    If #2 also has a bad equals, but the end of the if has an extra comma which infers more should be there: if( equals( triggerBody()['number'] ), 2, variables('SummeEtat'), ) If #3 is perhaps probably closest to what you're after, here, you wish it to be empty or null on the false branch.It just still has the bad equals : if( equals( triggerBody()['number'] ), 2, variables('SummeEtat'), '' )

    So, using your 3rd if() as a basis, this would run correctly:

    if(
     equals(
     triggerBody()['number'],
     2
     ),
     variables('SummeEtat'),
     ''
    )

    All that was done was moving that ',2' inside the equals(). Now it will check to see if triggerBody()['number'] is equal to 2 ... then it will pass the variable 'SummeEtat' if it is 2, and nothing if it isn't.

     

    Plus, as @tom_riha, mentioned, you can also use null. Just make sure that the input you're entering null into is able to accept a null value. 👍 ... @tom_riha wrote:

    Spoiler (Highlight to read)

    Hello @TimFe,

    I'd try two ideas:

    1. use null value

    if(equals(triggerBody()['number']),2,variables('SummeEtat'),null)

    2. keep the original value

    if(equals(triggerBody()['number']),2,variables('SummeEtat'),<the current value>)

    e.g.

    if(equals(triggerBody()['number']),2,variables('SummeEtat'),triggerBody()['number'])
    Hello , I'd try two ideas: 1. use null value if(equals(triggerBody()['number']),2,variables('SummeEtat'),null) 2. keep the original value if(equals(triggerBody()['number']),2,variables('SummeEtat'),<the current value>) e.g. if(equals(triggerBody()['number']),2,variables('SummeEtat'),triggerBody()['number'])

     

  • moko33 Profile Picture
    35 on at

    I found out that the dataverse record is NOT going to be updated (so it's doing nothing) if for the "do nothing case" your formula delivers the same value that the trigger already delivered.

     

    if(equals("do nothing","do nothing"),TriggerFieldContent,else...)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 605

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard