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 / Calculating Wait Time ...
Power Automate
Answered

Calculating Wait Time from Excel to SharePoint

(0) ShareShare
ReportReport
Posted on by 5,331 Moderator

Finally headed in the right direction.

I've gotten the 'InTime' and 'OutTime' to move through Power Automate and populate the new SharePoint list with the correct data.

Now, I need the difference between the two to be displayed in the 'WaitTime' column of the SharePoint list.

I have a formula in the Excel 'WaitTime' column that is calculating the difference in Excel.

Phineas_1-1680579305543.png


I'm now wondering if the Excel formula is adversely impacting the accuracy of any expression I write on the Power Automate
side.

What is the best practice for calculating and displaying the 'WaitTime' between 'InTime' and 'OutTime' in the Power Automate
flow and into SharePoint?

Phineas_2-1680579594780.png


The 'Create item' 'WaitTime' formula is -

          dateDifference('1899-12-30',items('Apply_to_each')?['WaitTime'])

Phineas_3-1680579973154.png

 

Categories:
I have the same question (0)
  • Sundeep_Malik Profile Picture
    6,501 on at

    Hey @Phineas 

     

    In your excel can you do it hh:mm:ss.

     

    Then in your power automate you can write an expression like this:

     

    formatDateTime(WaitTimeExpressionFromExcel,'hh:mm:ss')

     

     

  • Phineas Profile Picture
    5,331 Moderator on at

    Skip

  • Phineas Profile Picture
    5,331 Moderator on at

    As suggested, I placed the following in the 'WaitTime' field of the 'Create item' -

                dateDifference('1899-12-30',items('Apply_to_each')?['WaitTime'])


    I updated the Excel 'WaitTime' column with hh:mm:ss

    Phineas_2-1680614510984.png

     

     

    The result is still an error about the string/datetime value, which is a decimal value in the 'Create item' rather than the time value shown in Excel.

    Phineas_3-1680614511018.png

     

     

  • Sundeep_Malik Profile Picture
    6,501 on at

    @Phineas 

     

    Can you show the flow in edit mode, the expression you used there. 

     

    I told to use this expression:

    formatDateTime(WaitTimeExpressionFromExcel,'hh:mm:ss')

     

    Not this:

    dateDifference('1899-12-30',items('Apply_to_each')?['WaitTime'])

     

     

    Edited: Use this in your waitTime Text Box:

     

    formatDateTime(items('Apply_to_each')?['WaitTime'],'hh:mm:ss')

  • Phineas Profile Picture
    5,331 Moderator on at

    I apologize.

    I am unsure where to place your formula. Does it go in the 'WaitTime' field of the 'Create item' shown below?

    formatDateTime(WaitTimeExpressionFromExcel,'hh:mm:ss')

    Does the blue content above stay as it is or do I overwrite it with something local?

    Phineas_0-1680614808593.png

     

  • Sundeep_Malik Profile Picture
    6,501 on at

    @Phineas 

     

    Yes put it there in WaitTime:

     

    Sundeep_Malik_0-1680615125997.png

     

  • Phineas Profile Picture
    5,331 Moderator on at

    Nope, Power Automate doesn't like it.

    Phineas_0-1680615242480.png

     

  • Sundeep_Malik Profile Picture
    6,501 on at

    @Phineas 

     

    Add this:

     

    formatDateTime(items('Apply_to_each')?['WaitTime'],'hh:mm:ss')

  • Phineas Profile Picture
    5,331 Moderator on at

    Getting close. Power Automate took the formula; There is output to the SharePoint list; However, it is not accurate and not displayed in time hh:mm:ss.
    Phineas_0-1680616081557.png

     

  • Sundeep_Malik Profile Picture
    6,501 on at

    Pretty strange, because the formula I submitted should only show hours, minutes and seconds.

    Can you directly add the wait time action in create item once and see what output you are getting.

     

    Just add this:

     

    items('Apply_to_each')?['WaitTime']

     

     

    Let's see what output that gives

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 796

#2
Valantis Profile Picture

Valantis 568

#3
Haque Profile Picture

Haque 538

Last 30 days Overall leaderboard