How to dynamically write Google Sheet rows to Google Doc with automatic header handling?

I’m trying to create a scenario that does the following:

Goal:
Watch for new rows in a Google Sheet and automatically write them to a Google Doc, maintaining a specific format for each column’s data while being flexible for future column additions.

Desired Output Format in Google Doc:
For each column in the new row:
Column Header

Cell Value

Key Requirements:

  1. Must automatically detect and process ALL columns in the sheet
  2. Should handle any new columns added to the sheet in the future without scenario modification
  3. Each field should maintain the HTML formatting ( for headers,

    for values)

Current Setup:

  • Google Sheets > Watch Rows (configured to watch my sheet)
  • Need help with the next steps to process the data dynamically

What’s the best way to:

  1. Collect all column headers dynamically?
  2. Match each header with its corresponding value?
  3. Format and write to Google Doc with the specified HTML structure?

Any help with the correct modules and mappings would be greatly appreciated!