Google Docs: Make an API call (formatting, escape conversion)

Hi Makers,

I’m using the Google Docs “Make an API call”-module, but struggle with how it translates my request, any suggestions how to fix this?

Input: Price: LOPOB (1x TWIN) ← expected result
Output: Price: LOPOB (21x1365 T2730WIN) ← actual result

Input bundle:

[
    {
        "url": "/v1/documents/1PD4Cze0xHB0eTGPc5ZUsnJ7gbh82ZIjdcIV-mO-qrEo:batchUpdate",
        "body": "{'requests': [\n   {\n       'insertText': {\n               'location':{\n                   'index': 1719\n            },\n            'text': 'Price: LOPOB (1x TWIN)'\n        }},\n       {'insertText': {\n           'location': {\n                   'index': 1733\n            },\n            'text': '2'\n        }},\n       {'insertText': {\n           'location': {\n                   'index': 1736\n            },\n            'text': '1365'\n        }},\n       {'insertText': {\n           'location': {\n                   'index': 1742\n            },\n            'text': '2730'\n        }},\n]}",
        "method": "POST",
        "headers": [
            {
                "key": "Content-Type",
                "value": "application/json"
            }
        ]
    }
]

Thank you!

We gotta love the funky stuff @Zbulo;

What happens when you replace Price: LOPOB (1x TWIN) with something simpler like Hello?

Next, start building up your desired replacement string a character or two at a time to determine when or where it break?

I wonder whether there’s character encoding issues coming into play that we unintentionally create by our character string.

Thanks Michael, yes, the encoding is the issue and I don’t know how to escape it.

Most special characters seems to mess with it. Adding a € sign will error the module.

Anyone experience with Google Docs API to suggest a workaround/solution?

Okay @Zbulo; let’s step back a bit.

Please share a screenshot of how you’re building up that array for Google Bulk Update.

I’m curious to know, are you calling the API or using the Google Bulk Update?