0

I have following scripts that retrieves the data from a sharepoint list view. I can get the data and display but i want to download the data in json file. Everytime any users hits the page which has this scripts it prompts them to save the JSON file.

here is my script fuction that outputs the data in json format. i just need to create a json file out of that data and download it as a file

     getListViewItems('https://mysite','mylist','myview').done(function(data)
     {
      console.log(JSON.stringify(data));
      // data is the json result i want and i can print this to
      // console or display in the page but i want to add this to 
      // a json file and make it downloadable.  
     })
   .fail(
    function(error){
    console.log(JSON.stringify(error));
   });
user388969
  • 337
  • 1
  • 9
  • 30

1 Answers1

0

THis link may help you Download JSON object as a file from browser (See the accepted answer)

As you said you already have a json file with you and this link will give you a hint how to click that dynamically generated link and download a file.

Thanks

Community
  • 1
  • 1
Sigar Dave
  • 2,598
  • 1
  • 20
  • 42