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 / Incorrectly brings bac...
Power Automate
Answered

Incorrectly brings back dates from two years: Filtering a a text column containing 'date and time' in a SharePoint List

(0) ShareShare
ReportReport
Posted on by 195

Hi,

 

I currently have a SharePoint list and when a task is completed on a corresponding Planner, it updates the column 'Task Completed' with the date and time, the date is in format DD/MM/YYYY which is due to our location, the time is UTC time I believe (another flow get's the information from the 'Completed Date Time' of the task). Unfortunately I made this column in the list a text column, and I am having trouble filtering all tasks completed in the past month.

roxy1_0-1667374814046.png

Column settings:

roxy1_0-1667375859252.png

 

 

My expressions in the filter query are the following :

formatDateTime(startOfMonth(getPastTime(1,'Month')),'MM/dd/yyyy HH:MM:ss')
 
formatDateTime(startOfMonth(utcNow()),'MM/dd/yyyy HH:MM:ss')
 
 

roxy1_0-1667540816036.png

 

Unfortunately this does bring back the right days and months, but is bringing back both 2022 and 2021 results (when I only wanted this current year!). Can anyone help? Thank you!

 

roxy1_0-1667457878829.png

 

 

roxy1_1-1667457948254.png

 

 

Categories:
I have the same question (0)
  • CFernandes Profile Picture
    8,504 Most Valuable Professional on at

    Hey @roxy1 

     

    Can you try the Filter Query below -

     

    Created gt '@{addDays(utcNow('yyyy-MM-ddTHH:mm:ssZ'),-30)}'

     

    CFernandes_0-1667546290007.png

     

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

    P.S. take a look at my blog here and like & subscribe to my YouTube Channel thanks.

     

  • roxy1 Profile Picture
    195 on at

    HI @CFernandes thanks for the speedy reply!  I've tried your suggestion, however, it now brings back no values at all. I think this because the Task Completed date and time is not in this format in the SharePoint list.

     

    roxy1_0-1667546903634.png

     

    roxy1_1-1667546949617.png

     

  • CFernandes Profile Picture
    8,504 Most Valuable Professional on at

    Hello @roxy1 ,

     

    Can you perform the test below -

     

    Try with Created Column and see if it works - If it works.

    Change the Date Format 'MM/dd/yyyy HH:MM:ss' in your expression - the expression should be the below

     

     '@{addDays(utcNow('MM/dd/yyyy HH:MM:ss'),-30)}'

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

    P.S. take a look at my blog here and like & subscribe to my YouTube Channel thanks.

  • Verified answer
    grantjenkins Profile Picture
    11,063 Moderator on at

    A simple solution is to just change your Task Completed column from Single line of text to Date and Time.

     

    grantjenkins_0-1667569274860.png

     

    However, I would DEFINITELY test this on another list with the same formatting, etc. to confirm you don't get any data loss due to incorrect date formats already entered. You would also need to test the process that updates the SharePoint list from Planner to ensure it would still work as expected.

     

    I did a quick test in my site and have DD/MM/YYYY format and regional settings set to Australia, and all worked as expected.

     

    Benefits are you can use the actual dates in Power Automate and you also get proper Date sorting/filtering on the column/list.

  • roxy1 Profile Picture
    195 on at

    Hi Grant,

     

    I've been thinking about doing this too, and have read a lot about data loss. I will try this on a test list!

     

     

  • roxy1 Profile Picture
    195 on at

    Hi,

     

    So sorry this did not work either. I've had to change my column setting to 'Date and Time' unfortunately with some date loss I've had to manually enter again.

     

    Thanks for your suggestions though!

  • roxy1 Profile Picture
    195 on at

    I've had to change my column setting to 'Date and Time' as it was the only solution. Unfortunately with some date loss I've had to manually enter again!

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