cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Charlotte17
Regular Visitor

Email Notification from Dates in SharePoint Document Library - Flow Condition Expression Result False

Hi all,

 

I'm trying to build a flow, but I'm having issues with a condition not working, so any help would be much appreciated.

 

The goal of the flow is to get the items in a SharePoint document library, and look for whether there's a date in a specific column (End Date) which each file has, and if there is a date, to send an email 1 day before this date occurs.

 

I have a flow set up, and there are no errors so it runs, but it is not doing anything. I followed this example for the majority of it: https://powerusers.microsoft.com/t5/Building-Flows/add-days-to-sharepoint-list-date-element/td-p/599...

 

I might be wrong (so I've included images of the entire flow), but the problem seems to be when it gets to 'Condition 2', because every time, the expression result is false, no matter what adjustments I make or different things I try.

 

The 'Compose' step before it picks up whether there's a date, and what the date is, correctly, but 'Condition 2' does not trigger an action based on this, as is demonstrated in the images below:

 

Charlotte17_1-1647441978042.png

Charlotte17_2-1647442043028.png

I had to add the 'Condition 2' because I was getting an error message objecting to there being 'Null' values - it is not possible to enter a date for the 'End Date' column of every document.

 

This is the flow in edit mode:

'GetFilesPropOnly' is the action 'Get Files (Properties Only)'

Charlotte17_3-1647442511049.png

For below, the expression in 'Condition 2' is - empty(outputs('Compose'))

 

Charlotte17_6-1647442771200.png

For 'Condition' in the image below, the expression on the left is:

formatDateTime(body('GetFilesPropOnly')?['End Date'],'yyyy-MM-dd')

and for the expression on the right, I experimented with:

formatDateTime(addDays(utcNow(),-1),'yyyy-MM-dd')

and also:

formatDateTime(addDays(‘End Date’,-1),'yyyy-MM-dd')

Charlotte17_7-1647443440986.png

 

I'm not sure where I'm going wrong, but I'm going wrong somewhere, so any help or advice would be amazing. Please let me know if you need some more information, or have any questions.

1 ACCEPTED SOLUTION

Accepted Solutions
Charlotte17
Regular Visitor

Managed to solve it! Turned out the condition 2 output being false was correct, so that wasn’t the problem. I’m still not entirely sure what exactly went wrong, but I tried a different approach and it worked, so I thought I’d better put it here in case anyone else encounters the same problem. 

I started off with the recurrence trigger. Then I used the get files (properties only) action, but added a filter query this time - End_Date ne null - (End_Date being the internal column name) so the get items action would only return files with the End Date column populated. 

Then I used an if condition - if End Date (using dynamic content) is equal to the expression formatDateTime(addDays(utcNow(),-1),’yyyy-MM-dd’)

 

And then I just added the action into the yes bit that I wanted to have happen (for me it was sending an email). 

Hope this helps someone 🙂

View solution in original post

2 REPLIES 2
Charlotte17
Regular Visitor

Managed to solve it! Turned out the condition 2 output being false was correct, so that wasn’t the problem. I’m still not entirely sure what exactly went wrong, but I tried a different approach and it worked, so I thought I’d better put it here in case anyone else encounters the same problem. 

I started off with the recurrence trigger. Then I used the get files (properties only) action, but added a filter query this time - End_Date ne null - (End_Date being the internal column name) so the get items action would only return files with the End Date column populated. 

Then I used an if condition - if End Date (using dynamic content) is equal to the expression formatDateTime(addDays(utcNow(),-1),’yyyy-MM-dd’)

 

And then I just added the action into the yes bit that I wanted to have happen (for me it was sending an email). 

Hope this helps someone 🙂

Hi @Charlotte17 

Thanks for your posting and sharing the solution in the forum as it would be helpful to anyone who encounters similar issues.

You could go ahead and mark your post as solved by clicking “Accept as Solution” so that this thread will be marked for other users to easily identify!

Best Regards.

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 (1,657)