showModalDialog LF

102 views
Skip to first unread message

Bitey 6000

unread,
Jul 15, 2022, 7:34:47 AM7/15/22
to Google Apps Script Community
Hi all,

Just a quick one - is there any way to add a line feed after '+address+'?

SpreadsheetApp.getUi().showModalDialog(template.evaluate().setWidth(850).setHeight(380), Venue+' - Address: '+address+' Contact: '+contact+' - Tel: '+tel);

thanks for your help!

Clay Smith

unread,
Jul 15, 2022, 7:52:00 AM7/15/22
to google-apps-sc...@googlegroups.com
Have you tried \n for new line?

SpreadsheetApp.getUi().showModalDialog(template.evaluate().setWidth(850).setHeight(380), Venue+' - Address: '+address+'\nContact: '+contact+' - Tel: '+tel);

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/a7c8af6e-0f05-4203-8ee8-f0c97e02a3fdn%40googlegroups.com.
--


Message has been deleted

Bitey 6000

unread,
Jul 15, 2022, 8:15:27 AM7/15/22
to Google Apps Script Community
Yep - didn't work for me :(

dimud...@gmail.com

unread,
Jul 15, 2022, 8:18:15 AM7/15/22
to Google Apps Script Community
Try using <br/> instead of /n.

Bitey 6000

unread,
Jul 15, 2022, 9:22:33 AM7/15/22
to Google Apps Script Community
Yep have previously tried that as well
I'm not sure it's possible.

Edward Ulle

unread,
Jul 15, 2022, 9:27:55 AM7/15/22
to Google Apps Script Community
I tried several different way of creating a multiline string including back ticks and nothing works.  It seems the dialog doesn't support a multiline title.

dimud...@gmail.com

unread,
Jul 15, 2022, 9:42:19 AM7/15/22
to Google Apps Script Community
It should be possible since you're evaluating an HTML template. Try wrapping the text in paragraph tags <p></p> or break tags <br></br> (maybe the shorten version <br /> is not supported). If those don't work you might want to post the code showing how you generated the template as you might have an issue there.

Edward Ulle

unread,
Jul 15, 2022, 12:42:50 PM7/15/22
to Google Apps Script Community
The dialog may be HTML template but the title is string.   showModalDialog(userInterface, title) where title is string.  I have tried several different representation of title with and without HTMl without success.  If someone has a proven method please share.

frank 6000

unread,
Jul 16, 2022, 12:02:18 PM7/16/22
to Google Apps Script Community
I was asked to show the template assignment line here:
var template = HtmlService.createTemplateFromFile("form5");
SpreadsheetApp.getUi().showModalDialog(template.evaluate().setWidth(850).setHeight(380), Venue+' - Address: '+address+' Contact: '+contact+' - Tel: '+tel);

It seems that, as mentioned above, the Title is a string which does not respond to formatting. :(
Reply all
Reply to author
Forward
0 new messages