0

I'm Colombian my English it'is not good, I hope you understand me question. I'm setting up a Google Add-Ons on google docs (Google apps script) and I'm calling a google picker for choosing the file but I haven't been able to do that because I don't know how, when I click on select to send the file's id variable to the others file into the project with extension html or gs.

Please anybody help me. Thanks...

2 Answers2

0

It's hard to say without seeing your code. If you provide that it should make answering this questions a lot easier.

I'd recommend using either the DriveApp or the DocsList service to get the document id. To do that you'll do the following:

DriveApp:

//the variable blob should be whatever you get from the file picker
var file = DriveApp.createFile(blob);
var fileId = file.getId();
return fileId;

DocsLists:

//the variable blob should be whatever you get from the file picker
var file = DocsList.createFile(blob);
var fileId = file.getId();
return fileId;
Stan
  • 1,191
  • 2
  • 15
  • 27
0

Thanks for you answer, I was able to do it, I just used a hidden input and send it through a form, It looks like ->

<form id="form1">
   <input type="hidden" id="idFile">
</form>

When I click on select button picker, so ->

google.script.run.processForm(document.forms[0]);

The function "processForm" is into file with extension "gs".

I am writing that information cause I want to help anyone person with the same trouble.