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 / Creating a Date/Time v...
Power Automate
Unanswered

Creating a Date/Time value using string

(0) ShareShare
ReportReport
Posted on by

Within Power Apps I have a Date field and two dropdown fields. 

 

As Power Apps does not have a Date/Time field I am using this as Date, Hour (0-23 intervals of 1) and Minutes (0-50 intervals of 10).

 

I would like to use Power Automate to store this in a format that SharePoint would accept as my initial attempt was to use the below:

 

 

concat(outputs('Date'),' ',outputs('Hour'),':',outputs('Minute'))

 

 

Although this doesn't fail and it populates the list, it only enters the date with the time always being midnight.

 

Any ideas or recommendations would be appreciated! 😊

 

Thanks

 

Bradley

Categories:
I have the same question (0)
  • Verified answer
    ScottShearer Profile Picture
    25,270 Most Valuable Professional on at

    @Anonymous 

    Please see my example below.  I use three compose actions to store the components of the date time string.  In the FullDate compose action I use a concat action to create a valid date/time string - the expression can be seen in the action comments.  Then, I use a convert timezone action because SharePoint stores everything in UTC.  I then use the output of the convert timezone action to update the SharePoint list.  Please let me know if you have additional questions.

    DateTime.jpg

     

  • v-alzhan-msft Profile Picture
    on at

    Hi @Anonymous ,

     

    Please take a try with @ScottShearer 's sussestion.

     

    Best regards,

    Alice       

     

    Community Support Team _ Alice Zhang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Community Power Platform Member Profile Picture
    on at

    Hello @ScottShearer 

     

    Sadly it is not working, I get the below when using:

     

    concat(outputs('Date'),'T',outputs('Hour'),':',outputs('Minute'),'00Z')

     

     Annotation 2020-02-12 091116.png

     

    I tried amending the hour as it was missing the initial zero as shown, so I added the below to the Compose for Hour

     

    if(equals(length(triggerBody()['Hour_Inputs']),1),concat(0,triggerBody()['Hour_Inputs']),triggerBody()['Hour_Inputs'])

     

    Which now pulls through the Hours as 08 if length is 1 character (i.e. 0-9).

     

    The next issue I thought it could be was the date was pulling through as US Format so I used the below for the Compose for Date

     

    formatdatetime(triggerBody()['Date_Inputs'],'dd/MM/yyy')

     

    Sadly, this didn't work either.

     

    Anything else I can try?

     

    Thanks

     

    Bradley

  • ScottShearer Profile Picture
    25,270 Most Valuable Professional on at

    @Anonymous 

    Your date must be in a format that looks like this:  2020-02-12 

    The format string is yyyy-MM-dd

    In the example below, I use a compose action and a formatDateTime expression to convert to the proper format.

    ConvertDate.png

     

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard