Best answer

How do I convert data that comes through via email from CSV into Google Docs table format?


Userlevel 1
Badge

Hello,

 

How do I convert data from csv (that comes through via email) into Google doc table format? I am using “create doc from a template “ feature, however, I am having formatting issues 

 

Step 1: Find File from Gmail (works)

Step 2: Converting attachment into cvs using “Utilities” Formatter  (works)

I want to create a table (with exact same information in the csv) into a Google doc but coming across formatting challenges (Not working)

 

What Do I Need in a Table of Google Doc (Final Output)

Product Name.          Qnty

Product 1                    10

Product 2                    15

Product 3                    20

 

What I am actually getting post using Formatter 

 

Product Name: Product 1,Product 2,Product 3

Qnty: 10,15,20

icon

Best answer by jesse 17 June 2022, 19:27

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

13 replies

Userlevel 7
Badge +14

Hi @charlesriver 

Good question.

Unfortunately, I don’t believe the Zap action for Create Doc from Template supports HTML, whereas the Zap action Create Doc from Text does.

The HTML is how the Table would be created in the GDoc.

 

Userlevel 1
Badge

@Troy Tessalone Is there a way to create a table or something similar to a table from Google Sheet ==> Google doc? 

Userlevel 7
Badge +14

@charlesriver 

Yes, it’s possible to create tables in GDocs with HTML.

HTML resource for Tables: https://www.w3schools.com/html/html_tables.asp

Userlevel 1
Badge

@Troy Tessalone Thanks

Quick Question - In the above HTML example, the cell data are pre-populated in the code. How would I link that in my HTML code if my data is coming from a google sheet or csv? Like one sheet would have 5 rows while the next time it could be 8 rows with different information. What is the best way to input that via Zapier? 

 

 

Userlevel 7
Badge +14

@charlesriver 

The Code would have to be configured to dynamically create X Table Rows.

Help topic about using FOR loops in JavaScript Code:

 

Userlevel 1
Badge

@Troy Tessalone Having some challenges with this. Is there a way to convert output from “Utilities - Tranform” data into pdf or excel or google sheet? 

 

Below is the output data and just need them to be converted (non table format) into pdf, docs, sheets, excel etc

 

 

Userlevel 7
Badge +14

@charlesriver 

Each output format requires a different approach/app.

For example with GSheets, you can use the Create Row(s) action.

 

Userlevel 1
Badge

@Troy Tessalone what if I want to create a doc? I think with doc, I am not dependent on one specific spreadsheet

Userlevel 7
Badge +14

@charlesriver 

Might be better if you were to provide a screenshot with the desired output for us to have context about what you are trying to achieve with the layout/format/structure of the data points.

 

Looping can be used to handle line items: https://zapier.com/apps/looping/help

 

With a GDoc, there are 2 options, only 1 supports HTML.

 

Userlevel 7
Badge +12

HI @charlesriver!

Were you able to put this one together based on Troy’s suggestions? I’d love to hear if you got this up and running 😊

Userlevel 7
Badge +9

Hey @charlesriver! Summarizing some of the suggestions here for anyone following along that has a similar question.

 

If you want to create a table in a Google Doc, Troy is correct that the you can do this using HTML and that the Zap action you need for that would be Google Docs Create Doc from text: 

 

If you will have a different number of line items each time, then in this case Troy suggests using Code to have this happen dynamically.

@charlesriver

The Code would have to be configured to dynamically create X Table Rows.

Help topic about using FOR loops in JavaScript Code:

 

 

Sometimes a good option when you want to use line items in different steps of the Zap, Looping may be another thing to explore: https://zapier.com/apps/looping/help. I’m not sure if that would work in this case because you need you need each line to go into one Create Doc from text step, you can’t add each line item one at a time. 

That should get you pointed in the right direction but as always, feel free to come back to this thread with more details on your setup/workflow and we can keep digging into this!

Userlevel 1
Badge

@Danvers Unfortunately  I was not able to make it work. I haven’t spent more time on it 

Userlevel 7
Badge +9

@charlesriver would you be up for sharing where you’re getting stuck? We’d love to continue supporting you in getting this set up and working!