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 Platform Community / Forums / Power Automate / When 'if condition is ...
Power Automate
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. 

 

Categories:
I have the same question (0)
  • fchopo Profile Picture
    8,003 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
    13,060 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
    13,060 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
    13,060 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
    13,060 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard