Search code examples
google-chromegoogle-apps-scriptgoogle-sheetsline-breaks

How to use a line break in an alert/prompt dialog in Google Apps Script?


I have been having trouble with formatting a dialog in Google Apps Script. I would like to have a dialog using SpreadsheetApp.getUi().alert(prompt) which has a line break so I can have a list. I tried using \n, \\n, and <br />, but nothing appears to work and I can't find anything anywhere on whether or not it is even possible. Any ideas?


Solution

  • I went through this same problem. This actually works:

    \r\n