Home > OS >  How to get in Apps Script the value of a dropdown in a Google Doc?
How to get in Apps Script the value of a dropdown in a Google Doc?

Time:07-12

Google Docs now supports dropdown inputs (Insert > Dropdown). I am using Apps Script to access a Google Docs, and would like to get the value of a drop down.

I have read enter image description here

When this script is tested to the above Document, the following result is obtained.

{ row: 0, col: 0, text: 'sample1' }
{ row: 0, col: 1, text: 'sample2' }
{ row: 0, col: 2, text: 'sample3' }
{ row: 1, col: 0, text: 'sample3' }
{ row: 1, col: 1, text: 'sample2' }
{ row: 1, col: 2, text: 'sample1' }

Note:

  • Of course, I think that by parsing DOCX data, you can also retrieve the values from the table. But, I thought that when Document service (DocumentApp) can be used, when it is used, the script will be simpler. So, I proposed to convert from DOCX to Document.
  • Related