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 / How to calculate the t...
Power Automate
Answered

How to calculate the time elapsed between the date an approval request is sent and the approval date of each approver

(0) ShareShare
ReportReport
Posted on by 11

I have a flow that triggers when a new item is created in a SharePoint list which contains an approval in which everyone must respond.

ScottDev_0-1692775508707.png

In SharePoint I have created a column to have a timeline of the approvals where to record this data:

 

ScottDev_4-1692775632912.png

 

When the approvers have answered if they all have approved, the status column of the SharePoint list is updated to Approved, if someone has rejected the Status column is updated to Rejected.

In both cases, in the Timeline column, the following are recorded:

  1. The name of the approver
  2. Date I answer the approval
  3. Approval Comments

4.Time elapsed (using the date and time function dateDifference) but I get an error when executing the flow

ScottDev_1-1692775520678.png

ScottDev_2-1692775585143.png

ScottDev_3-1692775592009.png

Can somebody help me? I have been watching the video of Reza Dorrani:SharePoint Approval Timeline | Power Automate Approvals + Column Formatting + Approval History.
But there is no way to get the function to work, I'm stuck

 

Thanks

 

 

 

Categories:
  • Chriddle Profile Picture
    8,729 Super User 2026 Season 2 on at

    An example of the usage of dateDifference():

     

    dateDifference('2023-08-21', '2023-08-22')

     

    This returns 1.00:00:00

    What's the error message?

    And what are your function arguments?

  • Verified answer
    ScottDev Profile Picture
    11 on at

    Hi, these are function arguments 

    dateDifference(outputs('Iniciar_y_esperar_una_aprobación_N1')?['body/completionDate'],outputs('Iniciar_y_esperar_una_aprobación_N1')?['body/requestDate'])
     
    This time runs well but there are 3 approvrer, but only storedin Sharepoint  the latest one info
    ScottDev_0-1692779534840.png

     

    This is how it´s seen in TEAMS

    ScottDev_1-1692779653973.png

    Thanks for your help

  • Verified answer
    Chriddle Profile Picture
    8,729 Super User 2026 Season 2 on at

    You update the item as part of an "Apply to each" and overwrite previous updates.

    That's why you only get the latest.

    Just read the item before updating and update with the concatination of previous and new value.

     

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
11manish Profile Picture

11manish 307 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 289

#3
Henil Profile Picture

Henil 127

Last 30 days Overall leaderboard