Convert Duration Formats
Some third-party phone integrations (for example, Five9) only provide duration in the (hh:mm:ss) format whereas the Metric Builder requires duration to be the raw number of seconds.
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 )
Comments
0 comments
Article is closed for comments.