How to read the assets json file.

5 Comments

  • Tipene Hughes
    Zendesk Developer Advocacy

    Hi Vishwanath,

    Just to clarify, are you referring to the guide help center code editor?

    0
  • Vishwanath Hokrani

    Hi Tipene,

    Yes, I'm referring to the guide help center code editor.

    0
  • Tipene Hughes
    Zendesk Developer Advocacy

    Thanks for update!

    Unfortunately you can’t render json data uploaded as an asset directly in the script.js or .hbs templates. A couple of options could be to store the data as an object directly in the script.js file and push the data to your templates from there, or you could store the data externally and make a call to retrieve it in your script.js file.

    Let me know if you have any questions!

    Tipene

    0
  • Vishwanath Hokrani

    Hi Tipene,

    Could you please tell me how to do 2nd options i.e. "could store the data externally and make a call to retrieve it in your script.js file."

    0
  • Tipene Hughes
    Zendesk Developer Advocacy
    Hi Vishwanath,

    This wouldn't be a Zendesk specific process to implement. Essentially, with the 2nd option you'd want to look at using a backend database where you could store the information you want to access, then fetch the data by making a call to the database API in your script.js file. A quick Google search should return some good resources that will get you moving in the right direction.
    0

Pleasesign into leave a comment.

Powered by Zendesk