Convert Duration Formats
Some third-party phone integrations only provide duration in the (hh:mm:ss) format whereas the Metric Builder requires duration to be the raw number of seconds to properly calculate duration values into minutes, hours, days, etc for display within Ambition.
For example, "00:01:12" needs to be 72.
The conversion can be achieved by creating a custom formula Field in Salesforce and then building a Metric summing this custom Field.
Salesforce Duration Formula
/* Naive conversion using Datetime arithmetic */ IF( NOT(ISBLANK(YOUR_DURATION_FIELD_HERE)), ( DATETIMEVALUE("2020-01-01" + " " + YOUR_DURATION_FIELD_HERE) - DATETIMEVALUE("2020-01-01 00:00:00") ) * 1440 * 60, NULL )
Article is closed for comments.