Recent searches


No recent searches

How to take the backup of the data from the Localstorage into cloud server or database while using ZAF client



Posted Jan 28, 2022

Hi Zendesk,

 

I have created an application that sets the timer, for example, to:

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.

 

 

Below are some requests/challenges I have been facing:


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. 


2. As far as the localStorage is concerned, once the data is saved in that localStorage, how to fetch that information, for example, into SharePoint or excel sheet in my local drive because I have 500 agents who would be using this app, how to make sure that I do not lose the data, if anything I have to do to use at the API endpoint or something, please let me know. "How to take the backup of the data from the Localstorage into cloud server or database while using ZAF client"


P.S. I am making the app using React Library into JS for the logic to work. 

 

I look forward to hearing from you.

 

 


1

5

5 comments

image avatar

Eric Nelson

Zendesk Developer Advocacy

Hi Nitesh,

I answered your 1st question in our original thread, feel free to see my answer over there. 😊 

2. If you want to have this information hosted on a cloud service, you'd most likely want to create this as a server-side app. This would 

1


Hello Eric,

 

Thank you for your response. I really appreciate it. 

I got the answer to the 1st question from you in the original thread, thank you for that. 

For the 2nd one though, I wanted to say that I already have my company's SQL database, I just want to save the data into that SQL database that our company has instead of cloud service, so what should I do to make sure that the data is saved in that SQL database? Could you please give me some examples or some codes that could help me achieve this?

 

1


image avatar

Eric Nelson

Zendesk Developer Advocacy

Hey Nitesh,

The concept is the same for saving into your SQL database as it would be to a cloud service. As this process isn't a specific thing to Zendesk we're getting outside the scope of what I can assist with, I'd suggest just handling the write action to your db like you would any other application. 

 
  appInstance.on("app.deactivated", () => {
    let time = request.body.spentTime;
    timeDb.run(`INSERT INTO timeTable (totalTime) VALUES (?)`, time, (error) => {
      if (error) {
        response.send({ message: "error!" });
      } else {
        response.send({ message: "success" });
      }
    });
  });

1


Thank you so much, Eric, this is really helpful. I really appreciate you going extra mile for me on this. 

Have a great day! :)

1


image avatar

Eric Nelson

Zendesk Developer Advocacy

You too, Nitesh.

1


Please sign in to leave a comment.

Didn't find what you're looking for?

New post