0

I try to create a python script who will replace a text box by a value taken from google sheet and replace every text box in my google slide that have a certain tag in description,I achieved taking my data putting it into a dict and now I'm trying to build the request here is what I tried but it will not work I know why but dont know the solution:

    for i in our_names:
        try:
            requests = [
                {
                    'replaceAllText': {
                        # I know here it's not 'containsText' but I wasn't able to find the correct parameter
                        'containsText': {
                            'text': "{{hours-%sweekly}}" % i,
                            'matchCase': True
                        },
                        'replaceText': our_names[i]
                    }
                }
            ]
            body = {
                'requests': requests
            }
            response = service.presentations().batchUpdate(
                presentationId=PRESENTATION_ID, body=body).execute()

            print('program replaced text instances for '+i)
            # prints a check icon
            check()
        except ValueError:
            # prints a cross icon
            error()

could you help me please ?

lolozen
  • 386
  • 1
  • 4
  • 19
  • From your question and script, I cannot understand about `a certain tag in description`. So can you provide a sample Google Slides? Of course, please remove your personal information. – Tanaike Sep 24 '19 at 22:42
  • here it is: https://docs.google.com/presentation/d/1nNlIKRDFL-BdCI_DV-FJkjPUVrdZmiBTprphxno9VyM/edit?usp=sharing – lolozen Oct 02 '19 at 07:19
  • Thank you for sharing the sample Slides. And also can you provide a sample values of `our_names`? – Tanaike Oct 02 '19 at 08:16

0 Answers0