3
votes

I am using Apps Script to create Google Docs. The Apps Script has been deployed as an API Executable. The Apps Script receives the request json, which it writes to the Google Doc. I am able to create and print the values from input JSON as String in Google Doc.

The input JSON has some of the properties whose value is HTML. How can I render the HTML in Google Doc using Apps Script?

1
You have the same scenario in this SO post, the answer here maybe helpful.MαπμQμαπkγVπ.0
I think this answer talks about something else, Mithun, were you able to figure out a solution for this?Mavi Domates

1 Answers

1
votes

Google Apps Script and the Google Docs API doesn't a built-in way to directly render HMTL and add the resuling display to the Google document.

The answer to Render HTML to a Google Doc using app script? offer a workaround: convert an HTML doc to a Google Document by using the Google Drive Advanced Service.

  1. Create an HTML and upload it to Google Drive
  2. Convert the HTML file to a Google Document format
  3. Get the content of the above Google Document and insert / append it to the document target.

Another option could be to use a third party service or a JavaScript library that does the HTML rendering.