Google docs "Create document from a template" is not working if there is more than 9 images

Hi, I am trying to solve an issue with the Google Docs module “Create document from a template”.
The example I give here is just a scenario that recreate the problem I am facing in another more complex scenario.

The scenario is pretty simple: I got a public image from GDrive and I want to insert it in 12 image blocks in a new file generated from a template.

The trigger contains just the url of the placeholder I want to add to the document:

The GDocs module is just inserting the url in each image blocks:

Here is the blueprint:

{
    "name": "Integration Google Drive",
    "flow": [
        {
            "id": 6,
            "module": "util:BasicTrigger",
            "version": 1,
            "parameters": {
                "values": [
                    {
                        "spec": [
                            {
                                "name": "placeholder",
                                "value": "https://drive.google.com/uc?id=1rvhokWG_SKMsGFkhOlvwZ9BcV0uFHq1K&export=download"
                            }
                        ]
                    }
                ]
            },
            "mapper": {},
            "metadata": {
                "designer": {
                    "x": 0,
                    "y": 0
                },
                "restore": {
                    "parameters": {
                        "values": {
                            "items": [
                                {
                                    "spec": {
                                        "mode": "chose",
                                        "items": [
                                            null
                                        ]
                                    }
                                }
                            ]
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "values",
                        "type": "array",
                        "label": "Bundles",
                        "required": true,
                        "spec": [
                            {
                                "name": "spec",
                                "label": "Items",
                                "type": "array",
                                "required": true,
                                "spec": [
                                    {
                                        "name": "name",
                                        "label": "Name",
                                        "required": true,
                                        "type": "text"
                                    },
                                    {
                                        "name": "value",
                                        "label": "Value",
                                        "required": true,
                                        "type": "text"
                                    }
                                ]
                            }
                        ]
                    }
                ],
                "interface": [
                    {
                        "name": "placeholder",
                        "label": "placeholder",
                        "type": "text"
                    }
                ]
            }
        },
        {
            "id": 5,
            "module": "google-docs:createADocumentFromTemplate",
            "version": 1,
            "parameters": {
                "__IMTCONN__": 356279
            },
            "mapper": {
                "select": "dropdown",
                "name": "Test",
                "destination": "drive",
                "from": "drive",
                "document": "/1o4JsTxaMfVLcUhZh89m2o6bgRzWOw4H0/12nPhUYpYWJcl3V-2zIPY92h4dVM7cVcS/1YjlIHOhQokTF8FRpwyGhqbFH4HPDTEJMH5bPGXW2zJs",
                "image": {
                    "kix.gu9oi1vbb7o50": "{{6.placeholder}}",
                    "kix.rc1zadpi4p021": "{{6.placeholder}}",
                    "kix.a63u9s377y4t2": "{{6.placeholder}}",
                    "kix.x50oy3876g9g3": "{{6.placeholder}}",
                    "kix.oz5oa2xt5zgw4": "{{6.placeholder}}",
                    "kix.yjibdo9qr5sh5": "{{6.placeholder}}",
                    "kix.c3n5z6bxcgyi6": "{{6.placeholder}}",
                    "kix.7b9yyrbpvlxc7": "{{6.placeholder}}",
                    "kix.yf5kwpk88ykq8": "{{6.placeholder}}",
                    "kix.p8fc5im1regw9": "{{6.placeholder}}",
                    "kix.3pj3wdbk17vf10": "{{6.placeholder}}",
                    "kix.qqyx5gwtwd9z11": "{{6.placeholder}}"
                },
                "folderId": "/1o4JsTxaMfVLcUhZh89m2o6bgRzWOw4H0/12nPhUYpYWJcl3V-2zIPY92h4dVM7cVcS"
            },
            "metadata": {
                "designer": {
                    "x": 300,
                    "y": 0
                },
                "restore": {
                    "parameters": {
                        "__IMTCONN__": {
                            "label": "Google Account (g.lanzi@planbproject.it)",
                            "data": {
                                "scoped": "true",
                                "connection": "google"
                            }
                        }
                    },
                    "expect": {
                        "select": {
                            "label": "By Dropdown"
                        },
                        "destination": {
                            "label": "My Drive"
                        },
                        "from": {
                            "label": "My Drive"
                        },
                        "document": {
                            "path": [
                                "TMP",
                                "docs",
                                "TEMPLATE"
                            ]
                        },
                        "folderId": {
                            "mode": "chose",
                            "path": [
                                "TMP",
                                "docs"
                            ]
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "__IMTCONN__",
                        "type": "account:google",
                        "label": "Connection",
                        "required": true
                    }
                ],
                "expect": [
                    {
                        "name": "select",
                        "type": "select",
                        "label": "Create a Document from a Template",
                        "required": true,
                        "validate": {
                            "enum": [
                                "map",
                                "dropdown"
                            ]
                        }
                    },
                    {
                        "name": "name",
                        "type": "text",
                        "label": "Title",
                        "required": true
                    },
                    {
                        "name": "destination",
                        "type": "select",
                        "label": "New Drive Location",
                        "required": true,
                        "validate": {
                            "enum": [
                                "drive",
                                "share",
                                "team"
                            ]
                        }
                    },
                    {
                        "name": "from",
                        "type": "select",
                        "label": "Choose a Drive",
                        "required": true,
                        "validate": {
                            "enum": [
                                "drive",
                                "share",
                                "team"
                            ]
                        }
                    },
                    {
                        "name": "document",
                        "type": "file",
                        "label": "Document ID",
                        "required": true
                    },
                    {
                        "name": "image",
                        "type": "collection",
                        "label": "Image URLs",
                        "spec": [
                            {
                                "name": "kix.gu9oi1vbb7o50",
                                "type": "url",
                                "label": "Tab (Tab 1) - Body: Image No. 1",
                                "metadata": {
                                    "tabId": "t.0"
                                }
                            },
                            {
                                "name": "kix.rc1zadpi4p021",
                                "type": "url",
                                "label": "Tab (Tab 1) - Body: Image No. 2",
                                "metadata": {
                                    "tabId": "t.0"
                                }
                            },
                            {
                                "name": "kix.a63u9s377y4t2",
                                "type": "url",
                                "label": "Tab (Tab 1) - Body: Image No. 3",
                                "metadata": {
                                    "tabId": "t.0"
                                }
                            },
                            {
                                "name": "kix.x50oy3876g9g3",
                                "type": "url",
                                "label": "Tab (Tab 1) - Body: Image No. 4",
                                "metadata": {
                                    "tabId": "t.0"
                                }
                            },
                            {
                                "name": "kix.oz5oa2xt5zgw4",
                                "type": "url",
                                "label": "Tab (Tab 1) - Body: Image No. 5",
                                "metadata": {
                                    "tabId": "t.0"
                                }
                            },
                            {
                                "name": "kix.yjibdo9qr5sh5",
                                "type": "url",
                                "label": "Tab (Tab 1) - Body: Image No. 6",
                                "metadata": {
                                    "tabId": "t.0"
                                }
                            },
                            {
                                "name": "kix.c3n5z6bxcgyi6",
                                "type": "url",
                                "label": "Tab (Tab 1) - Body: Image No. 7",
                                "metadata": {
                                    "tabId": "t.0"
                                }
                            },
                            {
                                "name": "kix.7b9yyrbpvlxc7",
                                "type": "url",
                                "label": "Tab (Tab 1) - Body: Image No. 8",
                                "metadata": {
                                    "tabId": "t.0"
                                }
                            },
                            {
                                "name": "kix.yf5kwpk88ykq8",
                                "type": "url",
                                "label": "Tab (Tab 1) - Body: Image No. 9",
                                "metadata": {
                                    "tabId": "t.0"
                                }
                            },
                            {
                                "name": "kix.p8fc5im1regw9",
                                "type": "url",
                                "label": "Tab (Tab 1) - Body: Image No. 10",
                                "metadata": {
                                    "tabId": "t.0"
                                }
                            },
                            {
                                "name": "kix.3pj3wdbk17vf10",
                                "type": "url",
                                "label": "Tab (Tab 1) - Body: Image No. 11",
                                "metadata": {
                                    "tabId": "t.0"
                                }
                            },
                            {
                                "name": "kix.qqyx5gwtwd9z11",
                                "type": "url",
                                "label": "Tab (Tab 1) - Body: Image No. 12",
                                "metadata": {
                                    "tabId": "t.0"
                                }
                            }
                        ]
                    },
                    {
                        "name": "folderId",
                        "type": "folder",
                        "label": "New Document's Location",
                        "required": true
                    }
                ]
            }
        }
    ],
    "metadata": {
        "instant": false,
        "version": 1,
        "scenario": {
            "roundtrips": 1,
            "maxErrors": 3,
            "autoCommit": true,
            "autoCommitTriggerLast": true,
            "sequential": false,
            "slots": null,
            "confidential": false,
            "dataloss": false,
            "dlq": false,
            "freshVariables": false
        },
        "designer": {
            "orphans": []
        },
        "zone": "eu2.make.com"
    }
}

The point is: when I place the new image up to the 9th place, the doc is generated just fine. When I add the 10th (or more) url in the specific field, I got an error:

[400] Invalid requests[10].replaceImage: The object with ID kix.3pj3wdbk17vf1 could not be found.

It seems like after the 9th image, the API refuses to process the block’s id. Therefore, I got the error.

To be noted: The Google Module is performing 2 different calls. One is the copy of the template, the second is the filling of the fields/blocks. In case of 10 or more images, a document is created but it’s just a copy of the template.
Here’s the docs:
Template: TEMPLATE - Google Docs
Test (with error): Test - Google Docs
Test with 9 new images (no error): Test-correct - Google Docs

It worked since february until now. The original scenario fills the new doc with 18 images.

Any Idea?

Same issue here, working fine yesterday now not working. I’ve also noticed all of the mappings of the image files for every google doc template has been removed too. I think its something to do with the introduction of tabs in google docs…its the only thing thats changed I believe. I’ve also raised a helpdesk ticket as well. Hopefully they can fix soon I have 10s of workflows where google docs are created from templates and this is incredibly disruptive to those flows.

1 Like

Glad is something not depending on me and that I’m not alone.

I noticed the disappearance of the mapping in the image fields, but I though it was some kind of error on my side. The mapping disappeared on older scenarios versions, too, btw.

I am thinking of implementing the “Replace image with a new image” module, but it’s incredibly frustrating, since you have to reference the block id that is not easy to retrieve and not obvious to manage.

Yeah my fall back has been to shift the document creation part of the workflow to pabbly (which I already have an account for) as theirs is still working. Not ideal…hopefully they can get it back to what it should be soon

So, I write here what I know in case somebody will land here in search for a fix.
Apparently, since the Tab feature has been introduced in Google Docs, the module “Create document from a template” handles only up to 9 images to be inserted in the new document. Reason is unclear.

The solution I use is to add another module after the document creation. The module I use is “Replace image with a new image”.
Just place the id of the document created and then add as many images you like. To add an image, you need the url of the new image (it has to be public) and the object id of the image block in which the new image will be placed.
Te retrieve the object id, you can use the module “Get content of a document” and then iterate through the inlineObject array of collection.

Hope that helps :slight_smile:

Thanks Giacomo, question if you happen to know the answer - is the restriction on the make module or change to what the API will handle (ie is this on make or google)?

I don’t know for sure, but based on the behaviour I think it’s on Google.
Since the update of any image box is available through the object id and another module, I suppose the endpoint for creating a document can’t handle an array of object greater than 9 anymore. But those are just suppositions.

1 Like

Hello Giacomo and David,

Faced with the same problem, I modified scenarios in an emergency.

As turn around, I chose to create several documents of max 9 images each, then merge them with PDF.co.

A clue to understand the problem: the difference between the ID of the image to replace in the error comment vs. the real ID of the image.

For example, error comment : “The object with ID kix.6yoikoocgdyh1 could not be found.”

While the ID of the image is “kix.6yoikoocgdyh11”

This can give an indication of the origin of the problem, but knowing it doesn’t help us, does it?

Indeed is something I didn’t notice before, but it make sense. I am thinking about something preventing google of considering two digits index in images array. The two id you shared differs for a digit indeed…
I got no time right now, but I would look into the problem with this new element you provide and maybe understand a bit better the problem.

Thank you!

Hey Andre and Giacomo,

I raised a ticket with Make the same day I found, after some back and forth they confirmed today that the issue has been resolved. Initial tests look good (for a document with 26 images) - I do need to do more testing though.

Be mindful that you need to open the google doc template module in question, re-load all the fields (which should happen automatically) then re-map your image files to test. It appears all of the mappings have gone.

I’ll let you know if anything else comes up that isn’t working as expected but hopefully we are back to normal now

Yes I think because of this recent change, our docs image replacement temple stop working suddenly and all reload image fields are missing.
After re add all those missing values, it comes back working.
Make should do better in alerting their customer that impact others.

Definetly agree that I would have prefered to be notified about this.
It causes a bit of a friction with a client of mine.
My scenarios stopped working yesterday. Was it because of the fix they did?

Apparently this has been solved. The input doesn’t iterates with the qty of images. Number = 0 (end of the image ID)

[
{
“from”: “drive”,
“name”: “Check if module works fine 20-11-2024 09:27”,
“image”: {
“kix.9oikqxsxguka-t.0”: “https://hcti.io/v1/image”,
“kix.eoxwq5q1qrvo-t.0”: “https://hcti.io/v1/image/”,
“kix.fbrv46lhqn2i-t.0”: “https://hcti.io/v1/image/”,
“kix.gyc8le509xg6-t.0”: “”,https://hcti.io/v1/image/
“kix.hm5oti2gkigr-t.0”: "https://hcti.io/v1/image/
“kix.kb1jfxhk4l0t-t.0”: "https://hcti.io/v1/image/
“kix.mwoi7b9w2zbp-t.0”: "https://hcti.io/v1/image/
“kix.s7b008fr24y2-t.0”: "https://hcti.io/v1/image/
“kix.w4y9zv1itffh-t.0”: "https://hcti.io/v1/image/
“kix.xcbtc0innfof-t.0”: "https://hcti.io/v1/image/
},
“select”: “dropdown”,
“document”: