As previously stated:
...let's start from scratch
I have created a new sheet in Google Sheets.
I set number of columns and filled in the header. Then I locked the header so I will have the header visible on all the sheets of the pdf file.
I went to Extensions> Apps Script
and I pasted the code you corrected.
I clicked "Do deployment" and set it to "Everybody" so anyone using my app can access this sheet.
I copied script Url.
I have saved the project.
I went to File> Publish on Web, published and then copied the link to my sheet.
I copied ID and Gid from Url.
I inserted two web components into my project and set the blocks.
I clicked "Export Table" on my app on the phone and still nothing happened ...
... what did I do wrong?
that number should be a 0 (zero)
Use the fileName block, which will include the path
OK ...the "sharing" window appeared, so I ran the mail window, the pdf file was there, but it was not possible to open it because "the format is not valid" (both on the phone and on the computer )
Check that your Web2.Url looks like this (with your sheet ID and gid):
also you may need the viewPdf extension just to check that you are getting back a valid pdf...
Yes, my url is correct,
..so what is wrong?
...but they are different, why? ...link after publishing doesn't contain ID and Gid
...actually I didn't paste ID... I pasted the link obtained after publishing in the first text block:
So, please, tell me exactly what I should paste and where
...now, in the first text block I pasted the first part of url, and in the second text block the second part of url with ID and Gid
...still nothing, ...the pdf format results "not valid"
- Why are you publishing the spreadsheet? There were no instructions to do this.
- The sheet Id is everything after the
d/
and before the/edit
, and only this.... - Your gid = 0
Thanks a lot
I tried my best but at the moment I'm not getting my pdf.
Anyway I can't apply this method.
It has a strong limitation: if for some reason I can no longer keep my sheet on google drive or for some reason access to google sheets is no longer allowed, no user of my app will be able to export his table.
So please, can someone show me a method that makes my app independent while exporting the table?
I would need a clear explanation with an exact combination of the blocks and with other elements that are needed, so that I can easily apply that method.
Thank you
I added a sharing component to my demo app, and a button to activate sharing.
This setup Gmail with an email and the pdf attached, which sent perfectly.
You need to revisit your work in setting up the script and workflow. It does work.
Your comment regarding internet connection is valid, but without one you will not be able to send an email anyway