I am trying to use Ticks to calculate the time difference which can be in mins hours or days.
here is the formulae i am using and i am trying to add this to a string
div(sub(ticks(formatDateTime(utcNow(),'MM-dd-yyyy hh:mm:tt')),ticks(outputs('Start_and_wait_for_an_approval')?['body/completionDate'])),864000000000)
following is the error i am receiving at the flow
InvalidTemplate. Unable to process template language expressions in action 'Append_to_string_variable_3' inputs at line '0' and column '0': 'In function 'ticks', the value provided for date time string '01-26-2022 06:34:PM' was not valid. The datetime string must match ISO 8601 format.'.
Hi @alearner090 ,
To get the ticks of utcNow(), you don't need to parse it, you can directly pass it to ticks(). Also, utcNow and completionDate should almost be same if you're using this action right after the approval action.
In case you are planning to get the time taken for an approval to complete you can use the outputs of approval, which are responseDate, requestDate and completionDate. Below I've used completionDate and requestedDate,
div(div(sub(ticks(outputs('Start_and_wait_for_an_approval')?['body/completionDate']),ticks(outputs('Start_and_wait_for_an_approval')?['body/requestedDate'])),10000000)
If you have some intermediary actions after the approval action and the time difference checker, then you can do as below
div(div(sub(ticks(utcNow()),ticks(outputs('Start_and_wait_for_an_approval')?['body/completionDate'])),10000000)
Hope you find this helpful! 🙂
Kind Regards,
Shaik Sha
________________________________________________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.
User | Count |
---|---|
27 | |
16 | |
16 | |
12 | |
11 |
User | Count |
---|---|
42 | |
30 | |
28 | |
24 | |
24 |