google-sites

Sending an Email Notification from Google Sites

こ雲淡風輕ζ 提交于 2019-12-10 20:08:41
问题 I've been trying to set up an email notification for when I create a new announcement in my google site. I used a base code I found online but it isn't working for me. Here it is: function myFunction() { var url_of_announcements_page = "https://sites.google.com/announcements-page-link"; var who_to_email = "name@company.com" function emailAnnouncements(){ var page = SitesApp.getPageByUrl(url_of_announcements_page); if(page.getPageType() == SitesApp.PageType.ANNOUNCEMENTS_PAGE){ var

OnClick suddenly not working on Google Sites in Chrome

混江龙づ霸主 提交于 2019-12-10 03:55:59
问题 I wrote a page that used buttons with onclick to call a function as part of a set of practice problems and answers for my students. It has worked since July with no issues through Friday, September 5 at least. Today the buttons fail to function at all in Chrome, and I can't figure out why for the life of me. They do continue to function properly in IE. I've posted the simplest code I could write that won't work below. It's awfully simple, and honestly I think it's fine. It seems to work if I

Invoke app scripts with parameters from classic google site

人盡茶涼 提交于 2019-12-08 14:24:27
This is related to a question I have posted previously . I have a batch of CSV files that contain a data set obtained from an issue tracker tool. These I've uploaded to google drive and are presented as charts and lists from a google site. This works reasonable well as all I now have to do is update the files in google drive and the site is automatically updated. The displayed charts work well, but I want to present the lists as an HTML table (as opposed to an embedded sheet). An app script seems the most logical way to do this. However, in order to do this, I need to provide the URL of the

Example display of Google Spreadsheet data in Google site via Google Apps Script

◇◆丶佛笑我妖孽 提交于 2019-12-08 14:01:57
问题 I see that some people are trying to grab data from google spreadsheets via google apps script to stick in their google sites: How to access data on different Google Spreadsheet through Google Apps Script? I could bash away at code snippets, but I don't suppose anyone has got a working example anywhere? Many thanks in advance 回答1: I was looking for something like this: https://sites.google.com/site/testappscript2/ At the moment I don't think you'll see anything if you are not logged in to

How to add permission to Google site using spreadsheet?

倾然丶 夕夏残阳落幕 提交于 2019-12-08 09:35:07
问题 I want to add permission people who can access my site using spreadsheet. From More>Sharing & Permission > Add people I can do that manually but I'm thinking if its possible I place email address whom to share on a spreadsheet and Google site automatically allow access to them. Is that possible? Any appscript/way to do that? If so where is the documentation/way to do that? Did some Google search but couldn't find such data. Update [Site must be "Private" to work removeViewer] Following code

Display variable as html in Google App Script?

情到浓时终转凉″ 提交于 2019-12-08 08:20:51
问题 Let's say we have a variable. This variable was created in google app script. On that app script project, you have two files. First, the .gs file, where the variable came from. Next, you have the html file. How do you transfer the variable to html? GAS: function doGet() { return HtmlService.createHtmlOutputFromFile('index'); } function items() { var exmp = 45; document.getElementById("test").innerHTML = "You have " + exmp + " items"; HTML: <script> google.script.run.items(); </script> <div id

How to have a Google Form retrieve spreadsheet data and display it on a Google Site?

ぃ、小莉子 提交于 2019-12-08 07:10:51
问题 Desired Outcome: To be able to enter a search term in a Google Form (presumably but not necessarily; could be a form in a standard web page) and have the relevant data retrieved from a Google Sheet and displayed in Google Site web app. I learnt how to retrieve data from a parameterized URL and display in a Google Site in this question: How to include data in a URL for a Google Apps Script web app to read? So the "tech" for retrieving and displaying spreadsheet data is there but I don't know

Connecting to the Google Sites API as a “Service Account”

与世无争的帅哥 提交于 2019-12-07 23:21:54
问题 I am trying to read a feed from a Google Sites account (Google apps). I don't need my app to require every user to login so i created my ClientID as a "Service Account" in the "Google API console". I have added this Client ID and the scope (https://sites.google.com/feeds/) to the "Mange API client access" page in my google apps control panel. I connect using the code below, all constants are defined in my code with the right values. // api dependencies require_once(GOOGLE_API_PATH); // create

How to get the index of the selected item in a list box?

怎甘沉沦 提交于 2019-12-07 15:39:39
问题 I want to get the index of the selected item in a Google Apps Script list box not the selected item itself. All of the examples I've seen so far create a server handler that gets the value of the list box through var list1Value = e.parameter.list1; I want to get the index though so I can index into an array. I tried to use this solution http://productforums.google.com/forum/#!category-topic/apps-script/services/vXa57-9T6E4 but my script complained that indexOf wasn't recognized var

Google sites API, IllegalArgumentException(“Trying to set foreign cookie”) after RedirectRequiredException

北城以北 提交于 2019-12-07 09:09:02
问题 I am using the gdata-media-1.0-1.47.1.jar functionality to fetch media data using the com.google.gdata.client.media.MediaService.getMedia(IMediaContent mediaContent) method. For some requests I get a RedirectRequiredException. When I redo the getMedia request, using the url i get from RedirectRequiredException.getRedirectLocation(), I get an IllegalArgumentException("Trying to set foreign cookie") exception. From what I can see, the reason for this is that the domain in the response header