App Script authorizations associated with Google Sheets - google-apps-script

I have managed to incorporate an app into a Google sheet I was able to copy from a tutorial video. The app provides a Custom Menu in the sheet that allows a user to conduct a search of content across the sheet.
The sheet, with editor access and Custom Menu showing, is available here:
https://docs.google.com/spreadsheets/d/1fl2B9yrZA75Vm5KwVsLsZ4K2_GUYO35LQLYxDcSoauY/edit?usp=share_link
and it works fine even if I may do some more formatting.
The sheet is available via the Search Test button near bottom right on this page:
https://www.victoriasforestryheritage.org.au/resources/records.html
but, as you will see, I am unable to set authorizations in the back end so that any user on the front end can access the sheet with the custom menu showing so they can search the data. The link above shows the sheet, but without the Custom Menu.(The custom Menu appears to work if I prove Editor access, but obviously I do not wish to do that)
The use of Apps Script is totally new to me, and I have searched widely for help, but obviously have found no solution. I read what I think are the relevant Google documents but I simply do not have the depth of understanding to interpret them.
In summary, I wish any user of the website to be able to access a linked google sheet and be able to search that sheet using the Apps Script created Custom Menu .
I am functional with HTML and CSS and just beginning to try and learn some JavaScript. In other words you are corresponding with a relative novice.
I have tried different file access levels as indicated above, I have looked through Apps Script authorization process but frankly I have trouble understanding how and where the Script links to the sheet.
Any help would be much appreciated.
Richard

Related

Can a spreadsheet (with format an everything) , be attached to a sidebar of another spreadsheet?

I'm creating a calendario asignacion Tools that works with sheets.
I have already make it work but I want to know if it is possible to attach a whole spreadsheets into a sidebar of the spreadsheets of the assignation tool.

Moving an item from one Google form to a new Google form using google apps script

When editing a Google form manually, you can usually click on an item, and on the side appears a menu, which includes the button "import questions". This button is very useful for me as it allows me to collect questions from past Google forms and import them to new Google forms.
But I'm looking through the Forms documentation, and I can't figure out how to do this via Google apps script programatically.
Here is the documentation:
https://developers.google.com/apps-script/reference/forms/form
The closest thing to what I want is the .moveItem() method, which moves an item from one spot in a form to another. But it only works within the same form. I want to know if I could do it across forms. And ideally, instead of moving the item, it would make a copy of the item in the new form.
I considered the .getItems() method, but there doesn't seem to be a general .addItem() method I could use on the new form. Would I have to go through the painstaking process of having to identify each item type, and specify how the details of each one should be copied to the new form, including things like point values of a question and whether or not the question is required?
I want to import from forms that have all kinds of content: video, images, multiple choice questions, grid questions, number scale questions, etc. I feel that if I have to specify the details of each item type, it would take too long, and I would be bound to miss something or run into an error that may be impossible to solve. Is there not an easier way?
And if specifying each item type is what I have to do to import everything properly, has someone else created that code already that I can re-use?
Issue:
In the current stage, unfortunately, it seems that Forms Service cannot copy all items. Ref1, Ref2 Ref3. And, unfortunately, moveItem can be used for the same Google Form as you say.
Workaround:
In your situation, as a workaround, how about copying the source Google Form? And, when there are some items you want to remove, you can remove them. I thought that this process can be achieved by Google Apps Script.
But, I'm not sure about your actual Google Form. So I'm not sure whether this is a suitable method.
Future:
Recently, Google Forms API was announced. Ref When this API got to be able to be used, your goal might be able to be achieved by retrieving the object from Google Form. Unfortunately, I'm still not sure about the detail of it.

How to save image added in a Google Sheet cell to Google Drive?

I have a google sheet that is to be used by a third person.
The sheet contains a column that requires them to upload an image into the cell (using Google Sheets Image In Cell feature).
I want to be able to via Google Apps Script, save these images, with an appropriate name based on a value in the row, to a folder in my Google Drive.
Is this possible?
As #Tanaike said, there is currently no way to do that automatically unless you get the URL and doesnt work on generated images (like QR codes) either. Not even right click works for such.
Externally, the only solution for the moment would be to manually get a screen capture (the 'recortes' tool in Windows can help). To automate this you could do a script to move the browser, then take a capture and save it, then move the browser again, rinse and repeat , but still there is no direct solution inside Google Sheets.

How to edit choices with images in Google Script Editor?

I've got a Google Form which is attached to a spreadsheet and a script. It's got one radio button field. When a choice is made, I want to run the script to remove the choice from the list. So far so good - I've got this working well.
However, when I use images with the choices, the script removes all of the images. Is there a way of not deleting the images? Or at least a way of accessing the images associaed with a Choice to get me started?

How to call a script in Google Spreadsheet above a frozen row?

Above a frozen row I want to put an image that is linked to a script; e.g. click the image and a script runs.
I can insert an image and add a script to it, problem: can only be
done under frozen row.
I can insert an image using =image("imageurl";2), I can even put a
hyperlink to this =hyperlink("url"; image("imageurl";2)) and this
works nicely but I can't call a script.
Any ideas on how to solve this?
How do you add UI inside cells in a google spreadsheet using app script? ... shows how to insert a drawing and link it to a script. Unfortunately, as you've found, floating images are not allowed in frozen rows or columns, so that technique breaks down if you must freeze rows. A quick search on the interwebs will show that this has been a long-term complaint about Google Sheets. (For instance.)
There are options, none of them ideal:
Use a custom menu function instead. That means users need to hunt a bit to find the menu option to kick your script, but it does stay in view no matter where they are.
Use the hyperlink & image work-around you've described, but use a published script url as the target. That will allow you to run a google apps script, indirectly.
Use a sidebar. OK, this isn't actually supported in Sheets yet - visit Issue 3162 and star it for updates.