Connect Spreadsheet per record to Data Studio via Apps Script

58 views
Skip to first unread message

Duane Cusi

unread,
Mar 2, 2020, 12:49:07 PM3/2/20
to Google Apps Script Community
I have a question, I created a design in Data Studio, a PDF type that will only receive data per record in the spreadsheet. I want to loop the records of the spreadsheet one by one to pass per records to Data Studio and to compose it and export it as PDF. Is even it possible? I read a comment in Stackover flow that it cannot be done, I want to confirm it here in the community. I hope you could help me.

Jean-Luc Vanhulst

unread,
Mar 2, 2020, 12:56:52 PM3/2/20
to google-apps-sc...@googlegroups.com
Google spreadsheet connector for Datastudio works pretty well. What exactly are you trying to do?

On Mon, Mar 2, 2020 at 12:49 PM Duane Cusi <duanec...@gmail.com> wrote:
I have a question, I created a design in Data Studio, a PDF type that will only receive data per record in the spreadsheet. I want to loop the records of the spreadsheet one by one to pass per records to Data Studio and to compose it and export it as PDF. Is even it possible? I read a comment in Stackover flow that it cannot be done, I want to confirm it here in the community. I hope you could help me.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/d508636a-40f1-4ef5-87be-387edb5d52c9%40googlegroups.com.

Duane Cusi

unread,
Mar 2, 2020, 1:24:42 PM3/2/20
to google-apps-sc...@googlegroups.com
What I'm planning to do is that I want each record of the spreadsheet to be destructed in Data Studio, like per row. I'm planning to create a PDF with single data from each record in the spreadsheet.

CBM Services

unread,
Mar 2, 2020, 1:29:01 PM3/2/20
to google-apps-sc...@googlegroups.com
Just out of curiosity, why create a PDF file for 1 row of data? Have you considered alternatives like HTML instead? How large is that one row?

From: Duane Cusi
Sent: ‎2020-‎03-‎02 10:24 AM
To: Google Apps Script Community
Subject: Re: [Apps-Script] Connect Spreadsheet per record to Data Studio viaApps Script

What I'm planning to do is that I want each record of the spreadsheet to be destructed in Data Studio, like per row. I'm planning to create a PDF with single data from each record in the spreadsheet.

On Tuesday, March 3, 2020 at 1:56:52 AM UTC+8, Jean-Luc Vanhulst wrote:
Google spreadsheet connector for Datastudio works pretty well. What exactly are you trying to do?

On Mon, Mar 2, 2020 at 12:49 PM Duane Cusi <duanec...@gmail.com> wrote:
I have a question, I created a design in Data Studio, a PDF type that will only receive data per record in the spreadsheet. I want to loop the records of the spreadsheet one by one to pass per records to Data Studio and to compose it and export it as PDF. Is even it possible? I read a comment in Stackover flow that it cannot be done, I want to confirm it here in the community. I hope you could help me.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
Message has been deleted

Duane Cusi

unread,
Mar 2, 2020, 1:42:05 PM3/2/20
to Google Apps Script Community
I have an existing records, a thousand of them that why I can't do it manually, the spreadsheet data per record is already at 80 columns. I said that I will loop the records in the spreadsheet.

CBMServices Web

unread,
Mar 2, 2020, 2:24:22 PM3/2/20
to google-apps-sc...@googlegroups.com
Generating a pdf from a single row which has 80 columns will look pretty bad unless you are formatting it before converting to pdf.

There are facilities for converting blobs to pdf. Suggest you do that.

So pull a record, format it the way you want and place it in a blob.

Can use something like this:

var blob = Utilities.newBlob(row_record, 'text/html', blobName);
var tempfile = blob.getAs("application/pdf");

On Mon., Mar. 2, 2020, 10:31 a.m. Duane Cusi, <duanec...@gmail.com> wrote:
I have an existing records, a thousand of them that why I can't do it manually, the spreadsheet data per record is already at 80 columns. I said that I will loop the records in the spreadsheet.

On Tuesday, March 3, 2020 at 2:29:01 AM UTC+8, George wrote:
Just out of curiosity, why create a PDF file for 1 row of data? Have you considered alternatives like HTML instead? How large is that one row?

From: Duane Cusi
Sent: ‎2020-‎03-‎02 10:24 AM
To: Google Apps Script Community
Subject: Re: [Apps-Script] Connect Spreadsheet per record to Data Studio viaApps Script

What I'm planning to do is that I want each record of the spreadsheet to be destructed in Data Studio, like per row. I'm planning to create a PDF with single data from each record in the spreadsheet.

On Tuesday, March 3, 2020 at 1:56:52 AM UTC+8, Jean-Luc Vanhulst wrote:
Google spreadsheet connector for Datastudio works pretty well. What exactly are you trying to do?

On Mon, Mar 2, 2020 at 12:49 PM Duane Cusi <duanec...@gmail.com> wrote:
I have a question, I created a design in Data Studio, a PDF type that will only receive data per record in the spreadsheet. I want to loop the records of the spreadsheet one by one to pass per records to Data Studio and to compose it and export it as PDF. Is even it possible? I read a comment in Stackover flow that it cannot be done, I want to confirm it here in the community. I hope you could help me.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/d508636a-40f1-4ef5-87be-387edb5d52c9%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/53b1e5f8-a2dc-4ffb-9741-82d59391b6c0%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.

Alan Wells

unread,
Mar 2, 2020, 4:23:06 PM3/2/20
to Google Apps Script Community
You can put html through HtmlService, get a blob of html, and convert that to a pdf blob.
The pdf blob can then be used to create an pdf file.

  var html = "<html><div>Some content</div></html>";
  var hOut = HtmlService.createHtmlOutput(html);
  var pdf = hOut.getAs('application/pdf');//pdf blob - which must be used to create the file
  var file = DriveApp.createFile(name, content, mimeType);
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.

Michael O'Shaughnessy

unread,
Mar 2, 2020, 8:18:24 PM3/2/20
to google-apps-sc...@googlegroups.com
Just my 2 cents....
I have successfully used a template created in Google Docs, filled it with data from a spreadsheet then saved the Doc as a PDF.  This is obviously what the add on AutoCrat can do... I just didn't need all the "bells and whistles" that the add on has.

To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/986f61ad-fb09-4f30-8be6-780a4ac41888%40googlegroups.com.

Duane Cusi

unread,
Mar 2, 2020, 9:58:07 PM3/2/20
to Google Apps Script Community
Guys, you're not answering my question, you're giving me suggestions which is okay, but I need to clarity regarding my question.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.

Kim Nilsson

unread,
Mar 4, 2020, 2:49:27 AM3/4/20
to Google Apps Script Community
That's true, Duane, but sometimes the way you want to do things is wrong, and may need adjusting.

Alan Wells

unread,
Mar 4, 2020, 8:34:51 AM3/4/20
to Google Apps Script Community
Sorry that you're not getting an answer.  Some questions do go unanswered.  Not on purpose.  Especially for the more difficult questions.
Reply all
Reply to author
Forward
0 new messages