My data object is structured like this:
"parameters": {
"firstName": "Alexa",
"lastName": "Simpson",
"city": "London"
}
The task at hand involves implementing the following request: https://developers.google.com/docs/api/reference/rest/v1/documents/batchUpdate
I aim to construct an array of objects where the key of my data object corresponds to the value of "text". For example, "firstName" should map to {{text1}} and "Alexa" should map to "replaceText1" dynamically.
{
"requests": [
{
"replaceAllText": {
"containsText": {
"text": "{{text1}}",
"matchCase": "true"
},
"replaceText": "replaceText1"
}
},
{
"replaceAllText": {
"containsText": {
"text": "{{value2}}",
"matchCase": "true"
},
"replaceText": "replaceText2"
}
}
]
}