cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Get Items and Filter Array - To Send Email Based on Calculated Date Column

I have set up a Flow using Recurrence as a trigger in a list containing items with a Date and an UpdateEmailRecipientsDate (which is a calculated column 7 days prior to the Date column). Because I could not use the UpdateEmailRecipientsDate directly in the Get Items (due to it being a calculated date and throwing an error), I stumbled on a post on this Forum suggesting a Filter Array might be a solution (though that post was for a library and not a list).

 

My Flow is as follows:  Reccurrence (daily at 7 a.m.; I did select a time zone) > Get Items > Filter Array > Send an Email. The email should not send if there are no items where the UpdateEmailRecipientsDate is not equal to the current date. As set up, the Flow is sending out an email even when there is no entry with the UpdateEmailRecipientsDate equal to the current date (almost as if it is always reading the filter array as being true).

 

I have used the following expression to format utcnow for the comparison:

utcnow('yyyy-MM-dd')
 
Can anyone help me identify why the expression is always reading as true even when UpdateEmailRecipientsDate is not equal to the current date? I did check that the calculated column was set to display as date (and not date and time). Thanks in advance.FilterArrayFlowIssue.JPG

 

1 REPLY 1
JohnAageAnderse
Super User
Super User

Hello @Anonymous 

 

You should not need the Filter Array action! You should be able to use the Filter Query field in the Get Items action like this:

<your date field real name> gt '<expresssion: formatDateTime(addDays(utcNow(),-7),'yyyy-MM-dd')>'

 

Note that there are single quotes around the expression!

Try it out and tell us how it went.

 

You will have to add a Condition action before your Send an email notification, in which you test that items where found 🙂

length(body('Get_items')?['value'])

Flow.Hilowflow44.get items filter query condition.jpg

Kind regards, John

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,110)