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

5 댓글

  • 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
  • Nitesh Jaiswal

    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
  • 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
  • Nitesh Jaiswal

    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
  • Eric Nelson
    Zendesk Developer Advocacy
    You too, Nitesh.
    1

댓글을 남기려면 로그인하세요.

Zendesk 제공