Creating a dropdown list in a table cell using Google Docs App Script

I want to add a dropdown menu in a cell of a table within Google Docs, but I can’t seem to find any guidance on how to do this. Is it even feasible?

var newCell = tableRow.appendTableCell('');
var validationRule = document.newDataValidation().requireValueInList(['Option 1', 'Option 2'], false).build();
newCell.setDataValidation(validationRule);

Hey Claire29! As of now Google Docs doesn’t support dropdowns creators using App Script directly in docs tables :sweat_smile:. You might need to try workarounds like utilizing Google Sheets, linking them, and embedding the sheet in Docs if dropdowns are crucial. A bit of a detour, but it might help! :sweat_smile:

Currently, the capability to directly create dropdown menus in a Google Docs table via App Script is not supported. However, you can consider using Google Sheets for this purpose. You could create your dropdown in Google Sheets using data validation and then insert the sheet or create a linked table in your Google Doc. This allows for updating options directly through the sheet, providing the necessary dropdown functionality, albeit indirectly. It retains the core idea without sacrificing the dropdown requirement.

you might want to explore apps like forms or Google sheets for dropdowns. Docs is still lacking this feature directly. Using sheets, then linking their functionalities to Docs could be an option, though not a perfect solution :neutral_face:. But sometimes indirect methods work better than none! hope this helps! :blush:

You might consider exploring third-party add-ons available in the G Suite Marketplace that can enhance Google Docs functionality. While they won’t directly create dropdowns in table cells, some add-ons offer enhanced data visualization and interaction features. This could serve as a workaround until such functionality might be natively implemented. Although not ideal, leveraging Google’s ecosystem with such tools often opens up new possibilities of integration that aren’t initially apparent through basic scripting alone.