cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
livingstonep
Kudo Kingpin
Kudo Kingpin

Check if Date selector field is blank in MS Flow formula/expression

part of an email step, we are creating an HTML table, where certain rows are hidden using css.

 

So our expression formula (in the body of the Outlook - Send an email from a Shared Mailbox step looks like this:

 

if(
    And(
        Or(
            equals(triggerBody()['DD_Artwork']['Value'], 'Bargain New Store')
            , equals(triggerBody()['DD_Artwork']['Value'], 'Home & Fashion')
            ,equals(triggerBody()['DD_Artwork']['Value'], 'Home Store'))
        , @empty(triggerBody()?['StoreOpeningDate']))
    ,'tr.StoreOpenDate {display:visible}', 'tr.StoreOpenDate {display:none}')

this part, checking the Date Selector field StoreOpeningDate is not working:

 

, @empty(triggerBody()?['StoreOpeningDate']))

we have also tried:

 

, Not IsBlank(triggerBody()?['StoreOpeningDate']))

but we always get the error message The expression is invalid:
floe expression error message.PNG

so what's the right way to do this please?

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-yamao-msft
Community Support
Community Support

Hi @livingstonep,

 

Do you want to return “visible” when DD_Artwork equals Bargain new store/Home & Fashion/Home Store and Store Opening date is not empty, if not, return None?

It seems that there is a @ in the function you are using, please remove it and try again. I have made the following test and it just works fine.

The flow is triggered by SharePoint When an item is created or modified, then send an email. In the email body, use the following code to return results:

 

if(

    And(

        Or(

            equals(triggerBody()?['Title'], 'test1')

            , equals(triggerBody()?['Title'], 'test2')

            ,equals(triggerBody()?['Title'], 'test3'))

        , Not(empty(triggerBody()?['StartDate'])))

,'tr.StoreOpenDate {display:visible}', 'tr.StoreOpenDate {display:none}')

 

1.PNG

Besides, there is no IsBlank function in WDL functions that can be used in Microsoft flow, please check more available functions at here:

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

 

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

2 REPLIES 2
v-yamao-msft
Community Support
Community Support

Hi @livingstonep,

 

Do you want to return “visible” when DD_Artwork equals Bargain new store/Home & Fashion/Home Store and Store Opening date is not empty, if not, return None?

It seems that there is a @ in the function you are using, please remove it and try again. I have made the following test and it just works fine.

The flow is triggered by SharePoint When an item is created or modified, then send an email. In the email body, use the following code to return results:

 

if(

    And(

        Or(

            equals(triggerBody()?['Title'], 'test1')

            , equals(triggerBody()?['Title'], 'test2')

            ,equals(triggerBody()?['Title'], 'test3'))

        , Not(empty(triggerBody()?['StartDate'])))

,'tr.StoreOpenDate {display:visible}', 'tr.StoreOpenDate {display:none}')

 

1.PNG

Besides, there is no IsBlank function in WDL functions that can be used in Microsoft flow, please check more available functions at here:

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

 

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.
MK1
Helper IV
Helper IV

Hi 

In my scenario,

 

I am writing code for print form option.

Step1: I wrote a HTML code  for my application

Step2: I used this code on MS FLow 

  • first i'm calling powerapps
  • Prase JSON
  • Comple(HTML Code with parse JSON values added)
  • respond to powerapps
  • Creating an html file

Step3: after creating the flow. I was calling flow from powerapps

step4: Now i was able to get data into the html with flow

 

On my powerapps, based on dropdown select all the other feilds will populate, I'm unable to hide feilds based on dropdown selected value on HTMl.

is there any way to hide labels based on selected value on HTML

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (3,689)