How to save timer app data of my app in Zendesk
I have created an application that sets the timer, for example, to:
1. Begin the day
2. Lunch break
3. Tea break/coaching/training etc
4. End day.
I am building this app so that I could trace the agent's activity and this will help me know the productivity and utilization, further, this could help our Data Analysts to know the agent's logged in time, time spent on breaks, lunch etc. The overall activity of the agent could be noted and should be saved somewhere.
So I created the buttons in the HTML file and each of them has some logic that I have written in the JS file, everything is working fine but below are some requests/challenges I have been facing:
1. How to get an alert or confirm window on every button that is clicked within the app? Also, how to make sure that if an agent has punched in any break or then he is not allowed to even touch any touch till the time he/she ends that break?
2. How to create the logs of every button clicked and save the data of the app? (If I have to save the data in some database then how to integrate that database to communicate with that app within the Zendesk instance?)
3. How to make sure that the refresh button doesn't change the numbers (once the timer that has been set or any button has been clicked should not put the timer numbers back to zero once the Zendesk instance is logged out or on-page refreshed) in App, hence don't change the number on database either?
I have read a lot of developer articles and got a lot of help from there to how to create an app and everything but just for the above 3 questions, I have been trying to find the answers; any help would be greatly appreciated, once I find success in this whole CI/CD process and app finalization then I will put this app for free in Zendesk Marketplace.
The application would look like shown in the below snapshot.
I look forward to hearing from you.
Begin Day HH:MM: SS End Day
1st Break HH:MM:SS End 1-B
Lunch HH:MM:SS End L-B
2nd Break HH:MM:SS End 2-B
Coaching HH:MM:SS End C.
Training HH:MM:SS End T.
1. I'd suggest taking a look at using a modal to accomplish this.
2. You can pass this information to a database if you'd like, though it may more scalable to just put it into localStorage.
3. The Apps framework is client side so only runs while the session is active. Due to that, you'd want to listen for events such as app.deactivated, then pass the current timer value to localStorage.
Hope this helps,
Thank you for your response and the articles you have shared, they are really helpful. I have started working on "localStorage" which was really helpful for points 2 and 3, thanks a lot. I did read about the modal and everything else related to it, however, I am sorry, there was a typo in my 1st question, the correct one is:
1. How to get an alert or confirm window dialogue box whenever any button is clicked, for example: "Are you sure to start your first break? "Okay" or "Cancel" button within the browser while the app is running in the zendesk instance. (without leaving the zendesk instance) --So the "okay" button will start the break (if the agent is sure), if not sure then he/she would press "Cancel" button to make sure that break doesn't start.
Also, how to make sure that if an agent has punched in any break, for example, then he/she wouldn't be allowed to even touch any ticket till the time he/she ends that break? In order words, agents should not be allowed to work on any ticket or the window of the ticket should be frozen till the time he doesn't end that break which was started, which mean he has to click on "End break" to resume working on tickets.
I look forward to hearing from you.
The confirmation window would still be best to be handled by a modal. I'd suggest having the "okay" button, start the break timer, but not dismiss the modal. As long as the modal is active, the agent won't be able to interact with the rest of Zendesk in that window. Then once their break is done, you can automatically dismiss the modal.
Thank you so much, Eric, much appreciated. I will try that one.
Please sign in to leave a comment.