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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / filter array for a cal...
Power Automate
Unanswered

filter array for a calculated date field

(0) ShareShare
ReportReport
Posted on by 2

Hello, 

 

I have created a simple flow that is triggered once a day. The objective of this flow is to go and check, on daily basis, the expiry date and if any item meets that condition an email will be sent to the user. 

 

So on the sharepoint list I have created a calculated column which calculates the expiry date based on the issuance date. 

 

I know that Flow doesn't accept filtering calculated fields/column in Get Item action. Some suggest to create a Filter Array. I did but unfortunately the filter is not filtering and it is sending an email to everyone in the list on daily basis even though the expiry date is way far from today's date. 

 

Any one can help please? 

Thanks

 

Flow_FilterArray.JPG

Categories:
I have the same question (0)
  • Ellis Karim Profile Picture
    12,137 Super User 2026 Season 1 on at

    I would need to see some sample data for CertificateExpiry to help figure out why your filter is not working. In the mean time uou should add a condition to check if the Filter Array action returns any results. If not, do nothing, else process the results in your Apply to each loop:

    ekarim2020_1-1631395448816.png

    ekarim2020_2-1631395476140.png

    Ellis

  • The_Parisian Profile Picture
    2 on at

    Hello, 

     

    Thank you for your response? Do you mean the formula that I used for the date field calculations? So basically, the date is calculated based on the another a number field called "Critical". The expiry date varies subject to the content of the Critical field. 

     

    Here's the formula I used to create the calculated field "CertificateExpiryDate" - 

    =IF(Critical=1,DATE(YEAR([Certificate Issuance Date]),MONTH([Certificate Issuance Date])+11,DAY([Certificate Issuance Date])),DATE(YEAR([Certificate Issuance Date]),MONTH([Certificate Issuance Date])+35,DAY([Certificate Issuance Date])))
     
    Looking forward for your reply. 
     
    Thanks
    Tony
  • Ellis Karim Profile Picture
    12,137 Super User 2026 Season 1 on at

    I think what is happening is that the date values you are comparing in the Filter array action are not equal, even though they appear to have the same date in SharePoint:

    ekarim2020_5-1631647443481.png

    The CertificateExpiryDate field is a calculated field and the value we see displayed in SharePoint in the above example is 14/09/2021. But internally SharePoint stores this calculated date value along with a time stamp (midnight) as 2021-09-14T00:00:00Z (UTC format):

    ekarim2020_6-1631647573289.png

    So when you use the CertificateExpiryDate field in the Filter Array action and compare it with the formatted date from the UtcNow() function you are actually comparing two different values:

    ekarim2020_4-1631646890468.png

    I suggest that you try formatting the CertificateExpiryDate as yyyy-MM-dd in the Filter Array action:

    ekarim2020_2-1631645776205.png

    Try that and let me know how you get on.

    Ellis

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    i tried this but I am getting the error:

    Unable to process template language expressions in action 'Compose' inputs at line '0' and column '0': 'The template language function 'formatDateTime' expects its first parameter to be of type string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#formatdatetime for usage details.'.

     

    Not sure why, since I have already filtered the array to exclude null values for this column. Is it possible that the text in red is the issue?

     

    formatDateTime(item()?['Expiry_x0020_Date'],'yyyy-MM-dd')

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 474

#2
11manish Profile Picture

11manish 268

#3
David_MA Profile Picture

David_MA 243 Super User 2026 Season 1

Last 30 days Overall leaderboard