Separate names with a comma.
Discussion in 'Call Flow Designer' started by luca pellegrini, Sep 19, 2017.
I would like to use a variable to find the duration of the call and send it into an email
Hi @luca pellegrini,
In order to determine the duration of the call, you need to use a variable to store the date and time when the call started. So as soon as you receive the call, you use an "Assign a Variable" component to set a callflow/project variable, for example "callflow$.StartTicks", to "DateTime.Now.Ticks".
Then, when the call ends and you're about to send the email, you can calculate the number of seconds using the following expression:
That expression will take "DateTime.Now.Ticks" (which is the current tick counter) and will substract the start ticks. That will tell you the number of "ticks" between the start and the end of the call. Then you divide that by 10.000.000, which is the number of ticks in a second, and you get the number of seconds of the call.
Finally, in order to send it in an email message, you create the body or subject expression to include that value... If you need help with that let me know. Here you have an example on how to add a variable to the subject:
The same applies to the body...