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

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

When 'if condition is false' with If Empty condition 'if (empty(triggeroutputs)'

(0) ShareShare
ReportReport
Posted on by

Hi, 

 

When using If Empty function under Select, it still gives Null (blank) value even IF condition is false. 

 

if(empty(triggeroutputs()?['Next Due']),null, formatdatetime(triggeroutputs()?['Next Due'], 'yyyy-MM-dd')) 

 

MK18_0-1651241484450.png

 

 

MK18_1-1651241616531.png

 

Please advise how I can fix. 

 

I have the same question (0)
  • fchopo Profile Picture
    8,001 Moderator on at
    Re: When 'if condition is false' with If Empty condition 'if (empty(triggeroutputs)'

    Hi @Anonymous 

    Could you try the following expression?

    if(equals(triggeroutputs()?['Next Due'],null),null, formatdatetime(triggeroutputs()?['Next Due'], 'yyyy-MM-dd')) 

    Regards,

    Ferran

  • Community Power Platform Member Profile Picture
    on at
    Re: When 'if condition is false' with If Empty condition 'if (empty(triggeroutputs)'

    Thanks   @fchopo 

    but it still gave me the same result. 

     

  • VictorIvanidze Profile Picture
    12,839 on at
    Re: When 'if condition is false' with If Empty condition 'if (empty(triggeroutputs)'

    Try to initialize a string variable with 

    triggeroutputs()?['Next Due']

    Will you see any errors?

  • Community Power Platform Member Profile Picture
    on at
    Re: When 'if condition is false' with If Empty condition 'if (empty(triggeroutputs)'

    Hi @VictorIvanidze 

     

    Is this what you mean?

    MK18_0-1651324550909.png

    Under 'Select'

    if(equals(variables('NextDue'),null),null, formatdatetime(variables('NextDue'), 'yyyy-MM-dd'))
     
    Then, I get below error
    MK18_1-1651324716213.png

     

  • VictorIvanidze Profile Picture
    12,839 on at
    Re: When 'if condition is false' with If Empty condition 'if (empty(triggeroutputs)'

    OK it means  the variable is successfully initialized.  Now please show the value of NextDue variable after executing the flow.

  • Community Power Platform Member Profile Picture
    on at
    Re: When 'if condition is false' with If Empty condition 'if (empty(triggeroutputs)'

    please see below

     

    MK18_0-1651325567626.png

     

  • VictorIvanidze Profile Picture
    12,839 on at
    Re: When 'if condition is false' with If Empty condition 'if (empty(triggeroutputs)'

    Aha.

    Use this in Select:

    if(empty(variables('NextDue'),'empty', formatdatetime(variables('NextDue'), 'yyyy-MM-dd'))

  • Community Power Platform Member Profile Picture
    on at
    Re: When 'if condition is false' with If Empty condition 'if (empty(triggeroutputs)'

    It says, the expression is invalid

  • VictorIvanidze Profile Picture
    12,839 on at
    Re: When 'if condition is false' with If Empty condition 'if (empty(triggeroutputs)'

    My bad, sorry. Use this:

    if(empty(variables('NextDue')),'empty', formatdatetime(variables('NextDue'), 'yyyy-MM-dd'))

  • Community Power Platform Member Profile Picture
    on at
    Re: When 'if condition is false' with If Empty condition 'if (empty(triggeroutputs)'

    it shows as empty

    MK18_0-1651327609038.png

     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 722 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 461 Moderator

#3
developerAJ Profile Picture

developerAJ 283

Last 30 days Overall leaderboard