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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to check if a fiel...
Power Automate
Unanswered

How to check if a field (date) is blank AND it is within a specific number of days then send email

(0) ShareShare
ReportReport
Posted on by 133

I have a business process where I need to take the following steps....just not sure how to code it in FLOW:

 

Step 1: Determine if [Funded End Date] is NOT blank

Step 2: IF [Funded End Date] field IS blank do nothing  

Step 3: IF NOT blank determine if [Funded End Date] is 1 day greater than today

Step 4: If YES send an e-mail to specific people | If NO do nothing

 

Run this everyday at a specific time

 

This seems to be a pretty standard problem and I've used this code @equals(formatDateTime(item()?['Funded_x0020_End_x0020_Date'], 'MM/dd/yyyy'), formatDateTime(addDays(utcNow(), 10), 'MM/dd/yyyy'))   before to send notices.

 

The issue I'm running into is that the not all the Funded End Date fields have data, and won't.  So I the first part of the code throws an error becuase it's trying to evaluate a blank field

 

FLOW Blank Field Issue.png

 

Thanks in advance for any help! 🙂

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    on at

    Hey DarenD,

     

    I have ran into issues trying to evaluate too much in one expression condition - even if everything makes logical sense. Now I split up more steps, both Flow and my coworkers seem to like it better.

     

    I would

    1. Initialize a boolean Variable outside the loop
    2. Then inside your Apply to each, Set the Variable something like
      1. Set boolean Variable = not(empty(item()?['Funded_x0020_End_x0020_Date']))
    3. Add another conditional branch where if the Fund date is TRUE (not empty) continue on to your other within 10 days condition, else do nothing

    Capture.PNG

  • DarenD Profile Picture
    133 on at

    Sooo...what action/condition am I looking for to create the variable?  I can't seem to find it in the FLOW actions.

  • DarenD Profile Picture
    133 on at

    Oh my gosh....as soon as I posted this I found it. Sorry. 

  • DarenD Profile Picture
    133 on at

    Charles_John,

         I think I've followed the instructions provided but can't find the "true" boolean value. What am I missing?

     

    VariableIssue.png

  • kristof805 Profile Picture
    212 on at

    I basically do the same exact thing in my Flow. I first check if the date field on this SharePoint list is NOT blank with the following code inside a condition:

     

    @not(empty(triggerBody()?['column name goes here']))

    (the above is under an Apply to Each, just like you have it). So, if it is empty, nothing happens, if it is NOT empty, it goes to another condition where it checks if the date from the list is 30 days away from today or not. If it is not, nothing happens, if it IS 30 days away from today, I get an e-mail reminder sent to me.

     

    @equals(formatDateTime(item()?['Nextauditdue'], 'MM/dd/yyyy'), formatDateTime(addDays(utcNow(), 30), 'MM/dd/yyyy'))
  • DarenD Profile Picture
    133 on at

    I must be missing something, because I've got a Definition Error (see arrow) and I can't find "true" in condition value.

     

    VariableIssue2.png

  • kristof805 Profile Picture
    212 on at

    Hey @DarenD

     

    I actually use it without the variable initilization and true/false checking. I just add a condition under the Apply to each step and go to edit in advanced mode and paste the code in there. Also make sure the title of your column is correct but it looks like you've already done this from your screenshot.

  • DarenD Profile Picture
    133 on at

    Ah, let me try that and see if I can kick start this bad boy!

  • DarenD Profile Picture
    133 on at

    krisof805,

     The FLOW ran but I didn't get a notice and I've got one date set to 8/21/2018 (trying to test for just 1 day to see if I can get it to work).  Please see the two pix below:

     

    Something Didn't workSomething Didn't workNot sure if code is incorrectNot sure if code is incorrect

  • kristof805 Profile Picture
    212 on at

    @DarenD

     

    I think your first screenshot indicates that the Flow didn't get to that step because the item was empty in that particular instance?

     

    The second screenshot has your date out 10 days, and not 1, if I am not mistaken. I think you would need a date for 8/30/2018 or 8/31/2018 for the Flow to evaluate to true and send you an e-mail.

     

     

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard