Add Images to Products
Add Images to Products I have a products model and I want to include an image for each product which will be used to display image of a product in product details page. I want my users to be able to select image with a drive picker from our domain's team drive folder. There is an ImageURL field in my products model. "features" property of my Team Drive is set to: SUPPORT_TEAM_DRIVES "onDocumentSelect" property of my drive picker is below: app.popups.ModalLoadingIndicator.visible = true; var key = widget.datasource.item._key; var id = result.docs[0].id; google.script.run.withSuccessHandler(function() { app.datasources.products.load(function() { app.popups.ModalLoadingIndicator.visible = false; }); }).autoAddimage(key, id); which is referring to this server script: function autoAddimage(key, id) { var record = app.models.products.getRecord(key); record.imageID = id; record.ImageUrl = Drive.Files.get(id).webContentLink; app.saveRecords([record]); } For s...