Formula in CCPulse returns incorrect values

I have created a template in CCPulse for fetching the place details where an agent is currently logged in. A simple fornula has been configured in this template; content of which is as follows:

result.Text=state.PlaceID;

Even though the agent is logged in, CCPulse shows the value as ‘-0’. Could anyone explain what could be the possible reason for same?

Hi,

In order to work for this, the following must be done:

  1. define a stat on the stat server:
    [CurrentAgentStateDNAction]
    Category=CurrentState
    MainMask=*
    Objects=Agent
    Subject=DNAction

on a ccp template this stat must be included (later you can hide it, if you don’t need)

  1. create a formula on this template (similar you use):
    result.Text = GetAgentState();
    function GetAgentState()
    {
    if(state.type != “AgentState”) return “n/a”;
    var r = state.PlaceID
    return r;
    }

Hope this help,
Bandorka

Hi Bandorka,

Thanks a lot for your response.
I still have a doubt: What is the need to configure a new statistic in Stat Server in order to make this formula work?

-Genesys_user

On stat server (do this on the options tab of the stat server application) you need to configure a new statistics:

[CurrentAgentStateDNAction_NamOfTheStat]
Category=CurrentState
MainMask=*
Objects=Agent
Subject=DNAction

And when you create a new CCP template, add this stat first to the template

1 Like

If you don’t even know how to create a stat on StatServer highly recommend to ask an specialist to do this tasks…seems you are an end user only and no clue on Genesys platform…you can end damaging something if you do the wrong move.

Sorry I missed one more step:
In the CCPulse Application of CME, in Options, Set CustomStatistic, ExtendedCurrentStatus = true.

you can use this too and it will show you logon time too

result.Text = GetAgentState();
function GetAgentState()

{
if(state.type != “AgentState”)
return “n/a”;
var r = “(” + FormatDate(state.StartTime) + ") ";
r += " [Place: " + state.PlaceID;
r += " Login: " + state.LoginID + “]”;
for(var e = new Enumerator(state.DNs); !e.atEnd();
e.moveNext())
{ r += GetDNState(e.item()); }
return r;
}

function FormatDate(dateVal)
{
var dateObj = new Date(dateVal);
return dateObj.getHours() + “:” + dateObj.getMinutes() + “:”

  • dateObj.getSeconds();
    }

function GetDNState(dn)
{
var r = “(” + FormatDate(dn.StartTime) + ") ";
r += " [Switch: " + dn.SwitchID;
for(var e = new Enumerator(dn.Actions); !e.atEnd();
e.moveNext())
{ r += GetAction(e.item()) + " "; }
return r;
}

function GetAction(a)
{
var r = “(” + FormatDate(a.StartTime) + ") ";
r += a.Action;
return r;
}

1 Like