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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / SharePoint created dat...
Power Automate
Answered

SharePoint created date not available in dynamic content to map to date field in sql server

(0) ShareShare
ReportReport
Posted on by 23

Thanks in advance,

 

I noticed in my flow when I  map the created date from my SharePoint lib to a date field in SQL server,  the created date is not available in the dynamic content to select from however it is available if I map to a non date field from sql server.  Any reason why?

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,717 Most Valuable Professional on at

    Dynamic Content values are filtered based on the data type of the destination.  Since SQL only accepts certain kinds of Data Time values it filters the SharePoint date values out of dynamic content.  The easiest workaround is to use a compose action to pre-format the SharePoint date into a form that is acceptable to SQL.  Then use the compose from the dynamic content dialog.  SQL will normally want the date time in ISO 8601 format.  So you can use the following

    formatDateTime('SharePoint DateTime Value','o')
  • rpiazza Profile Picture
    23 on at

    Thanks for the quick reply;  I am confused.  I tried doing the following.  First I compose the date time of the Created date in SP with formatDateTime('Created','o')

     

    then use the output from that function to map to my datetime field in sql

    But it didnt work for me.... are my steps correct?  thanks

  • Pstork1 Profile Picture
    68,717 Most Valuable Professional on at

    What is the specific field type for the SQL field you are trying to update?  SQL has a variety of field types for Dates and Times, but the steps should work for a field of type DateTime in SQL.

  • rpiazza Profile Picture
    23 on at

    SQL Col is def as a datetime2(7), null)

  • Verified answer
    Pstork1 Profile Picture
    68,717 Most Valuable Professional on at

    Since its a Datetime2(7) I think you'll have to use a different format without the UTC code.  Try this one.

    formatDateTime('SharePoint DateTime Value', 'yyyy-MM-ddTHH:mm:ss.nnnnnnn')
  • rpiazza Profile Picture
    23 on at

    In my first compose I needed to remove the '' around Created,  in the second compose I formatted datetime from the output of the first compose with 'yyyy-MM-dd hh:mm'...seemed to work.

     

    Thanks for your help

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard