How to progressively fill variables in Make.com

Hello, I have a big question, how can I do so that when I receive new data, it is placed below it, because yes, I can put variables, but how do I ensure that every time there is new data, it is placed in the next row without changing the data that already existed? posted previously.

Example

Row 1: Data 1, Data 2, Data 3…

Row 2: New Data 1, New Data 2, New Data 3…

Row 3: …

I do not know if I explain myself very well

HI @David_P,

What is that file? Is it a Google Sheets? Excel? PDF? If it’s PDF, I don’t think you can because it’s not a structured document.

If it’s a Google Sheets you can use the Add Row action:

image

You have something similar for Excel:

image

L

If it’s a Google Doc you’re best bet may be to generate HTML for the whole page then create a new document based on that HTML. You’ll need to host the image somewhere publicly accessible for this to work.

Edit: And you’ll need to know all the rows before building the document.
If you want to continuously add rows there is technically a way to do it but it involves a lot of custom API. You’d need to read the document, find the index/position of the last row that has data, insert a row at that location, find the index/position of the new row, find each column, add data in each column, etc… it’s very painful.

2 Likes

Its a Docs
and I understand a little what you mean but it would be more or less to convert it to HTML and from that HTML work with it to customize the boxes with new data, could you tell me some API to do this

Don’t you think it is possible that it is filled out in a spreadsheet and when the client requests the document, the docs are filled in with the Excel data in some way?

Just trying to understand your workflow.

Your initial post stated you wanted to incrementally add rows, which to me, means you want to add rows during one scenario run, then later add more rows, etc… Is that right?

Yes, when a client requests a document, as long as you have all the data you need to build all the rows, you could build the document on-demand.
With Google docs, when tables are involved, I think the easiest way is to build the document in HTML, then create a new documenat based on that HTML, then perhaps download the document as PDF.
For me, this is the easiest method and how I do it on my projects.

You could do something like this…
Create a document to be used as a template that looks the same except replace the entire table with {Table} like this:

Then, in your scenario, build an HTML table in Make using Iterator and Text Aggregator so that you end up with your data in an HTML table.
Use the Text Aggreagtor to build the repeatable parts of the HTML, like
<tr><td>rowXcol1</td><td>rowXcol2</td></td>rowXcol3</td><td>rowXcol4</td>
Separate each row with a New Line.
The text aggregator would return something like this.

<tr><td>row1col1</td><td>row1col2</td></td>row1col3</td><td>row1col4</td>
<tr><td>row2col1</td><td>row2col2</td></td>row2col3</td><td>row2col4</td>
<tr><td>row3col1</td><td>row3col2</td></td>row3col3</td><td>row3col4</td>
<tr><td>row4col1</td><td>row4col2</td></td>row4col3</td><td>row4col4</td>

You place <table> tag and your table header row before the aggregated text then </table> after it.
Within <table> you can format the table how you like it (maybe use AI to help out here) and you can use formatting within the <td> and <tr> tags if you want too.

Finally, you download the template document as HTML using Google Drive module.
Inside the downloaded HTML, use replace() to replace the {Table} with your HTML, then create a new document using that HTML.

I know this was a lot but hope it makes sense and hope it helps!

1 Like