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 / Convert string to date...
Power Automate
Answered

Convert string to date datatype

(0) ShareShare
ReportReport
Posted on by 302

Hello there!

I got a flow where I want to get all rows where a datecolumn in my SharePoint list is within the past 4 weeks. 

 

The date in my Sharepoint is saved as;   dd-MM-YYYY

 

I am using the following 2 steps to get the date of last month. 

efeewfew_0-1639227037019.png

 

Which responds exactly with what I want;     13/11/2021

Now every row between the date of today (11/12/2021) and 13/11/2021, should be shown. 

So now I want to filter the Get Items from SharePoint using the option "Filter Query", with greater than option, but the compose step returns a string, and not a date. This gives me an error. How can I fix this?

efeewfew_1-1639227177715.png

 



Categories:
  • Verified answer
    Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Formatting a date returns a string formatted the way you want it. If you want to filter a collection by date where the filter parameter that is expected is an actual DateTime value, you don't need to do the conversion at all. Just pass in the actual DateTime value and that's it. Doesn't really matter if the format shown to you does not match what you see in SharePoint. It being a DateTime value means that SharePoint will recognize it as DateTime and will accept it.

  • BernardMath Profile Picture
    4 on at

    Power automate desktop with Windows 10

    Convert string to date time only works if the string was generated by using convert datetime to text.

    Paging through the replies to this problem shows statement using 'convert'. I assume this is via scripting sincw there is no such Action in Power Automate

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    That is incorrect. Convert text to date time works perfectly fine with all sorts of strings, as long as you provide the format of your string properly.

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 289

#2
11manish Profile Picture

11manish 288 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 125

Last 30 days Overall leaderboard