aws-samples / aws-serverless-connect-wallboard

Sample code for building a serverless wallboard for Amazon Connect.
MIT No Attribution
29 stars 16 forks source link

Dynamically Display of Agent #15

Closed Aikleong7 closed 1 year ago

Aikleong7 commented 1 year ago

I realize that only can display a limited number of agents if there are not enough cells, I'm having large number of agents and the display of agent is not dynamic to the agents active and also how do I display agent's information like Agent's Avg ACW and Duration.

Brettles commented 1 year ago

Have you tried using =activeagents instead of agents names? Only active agent names will then be put into the output.

AFAIK there's no easy way to determine the average wait time or call duration per agent. Connect doesn't publish metrics for each agent but it might be something that can be calculated by going through the Contact Trace Record data. One challenge I see there is that it would be historical and not real-time - the CTRs aren't available until after a call/contact is complete.

Another challenge is that in order to get the average call waiting or duration you'd need to calculate that across a specific historical period (last hour? last day? last shift?) and that data would need to be stored somewhere in order to be performant for the dashboard.

I'll have a think about it and see if there's something that can be done there.

Aikleong7 commented 1 year ago

I tried using =activeagents but if there are only 3 cells defined only will have 3 agents displayed but if i have 100 agents active it cannot display all. And also maybe can display the avg handle time or call handled by the agents. Is it possible for that?

Brettles commented 1 year ago

Unfortunately (today) you need to define the cells where you want data. So if you wanted to display (say) 50 agent details then you'd need to have 50 cells each with =activeagents in them.

Also, individual data per agent isn't available - including calls handled by each agent. Same as above - it's something that can probably be derived from the CTR data but it's not simple to do.

We are working on some enhancements - one of them may give you another way of displaying the agent data. Stay tuned.

Aikleong7 commented 1 year ago

Sure. Do update me as well!

Brettles commented 1 year ago

Pushed an update today. It's probably not exactly what you want (because it requires change on your side) but an idea:

You can now call the API and request JSON output rather than a preformatted HTML table. So what you could do is define a wallboard just for agents - have hundreds or thousands of cells if you like; then call the API to retrieve the wallboard (just put json=true on the end of the API call) and then parse at the front end and render how you like.

Let me know if that helps.

Brettles commented 12 months ago

Another option which is (now!) in the code:

When you retrieve call the API and ask for the JSON output (json=true) it does a bit extra for you. It returns the wallboard as you've defined it (so, all the rows and columns) but it also returns a dataset labelled AgentStates which contains all of the agents and all of their states. You don't need to define a huge table to store it in - you could have a (practically) empty wallboard definition and then render the agents however you like using the JSON output.