Hi, everyone! I have a flow that triggers once a form submission is complete and emails the submitter all the details of their response. It works fine but needs to do some calculations to the dates and times that were submitted in the form. The calculations are done in an excel sheet, but I need to mimic that same calculation in Power Automate. Here's what I have:
Thanks for your help! @PowerAppsWizard @gabibalaban
Solved! Go to Solution.
Hi @rhaddad87 ,
Do you want to calculate the time difference between two dates?
I have made a test for your reference.
1. Here is my Form.
2. Create a Flow.
substring(outputs('Get_response_details')?['body/TakeOffTime'],0,2)
substring(outputs('Get_response_details')?['body/TakeOffTime'],2,2)
concat(outputs('Get_response_details')?['body/TakeOffDate'],' ',outputs('Compose-starthour'),':',outputs('Compose-startminutes'))
formatDateTime(outputs('Compose-starttime'),'yyyy-MM-ddTHH:mm:ss')
substring(outputs('Get_response_details')?['body/LandTime'],0,2)
substring(outputs('Get_response_details')?['body/LandTime'],2,2)
concat(outputs('Get_response_details')?['body/LandDate'],' ',outputs('Compose-endhour'),':',outputs('Compose-endminutes'))
formatDateTime(outputs('Compose-endtime'),'yyyy-MM-ddTHH:mm:ss')
div(div(mul(sub(ticks(outputs('Compose-endtimeformated')),ticks(outputs('Compose-starttimeformated'))),100),1000000000),60)
div(outputs('Compose-minutesdifference'),60.0)
Result Screenshot:
Best Regards,
Charlie Choi
Hi @rhaddad87 ,
Do you want to calculate the time difference between two dates?
I have made a test for your reference.
1. Here is my Form.
2. Create a Flow.
substring(outputs('Get_response_details')?['body/TakeOffTime'],0,2)
substring(outputs('Get_response_details')?['body/TakeOffTime'],2,2)
concat(outputs('Get_response_details')?['body/TakeOffDate'],' ',outputs('Compose-starthour'),':',outputs('Compose-startminutes'))
formatDateTime(outputs('Compose-starttime'),'yyyy-MM-ddTHH:mm:ss')
substring(outputs('Get_response_details')?['body/LandTime'],0,2)
substring(outputs('Get_response_details')?['body/LandTime'],2,2)
concat(outputs('Get_response_details')?['body/LandDate'],' ',outputs('Compose-endhour'),':',outputs('Compose-endminutes'))
formatDateTime(outputs('Compose-endtime'),'yyyy-MM-ddTHH:mm:ss')
div(div(mul(sub(ticks(outputs('Compose-endtimeformated')),ticks(outputs('Compose-starttimeformated'))),100),1000000000),60)
div(outputs('Compose-minutesdifference'),60.0)
Result Screenshot:
Best Regards,
Charlie Choi
WOW!!!! Thank you so much for your time!!!
So, I did figure out how to do this on my own... it does not look as clean as your solution, but it's similar. I will post it for others to see:
Basically, I found out that you don't have to split out the hour and the minute in the military time format, you can just divide the military time format by 2400 and append that result to the serial date value.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
At the monthly call, connect with other leaders and find out how community makes your experience even better.
User | Count |
---|---|
26 | |
25 | |
23 | |
23 | |
21 |
User | Count |
---|---|
60 | |
40 | |
40 | |
29 | |
25 |