Getting syntax error in Python code step in zap

by GAM   Last Updated August 14, 2019 05:26 AM - source

I’m getting a syntax error but don’t understand why.

I’m writing a simple Zap Code step to set up some values based on some input values with a series of if-else statements.

if input_data.['workbench'] == 'True':
    workbench = 'False'
    workbench = 'N.A.'
if input_data.['office'] == 'True':
    office = 'False'
    office = 'N.A.’   # this is the line with the error

When I send a test run of Python to Code, I get:

Traceback (most recent call last): SyntaxError: invalid syntax (, line 8)

I don’t expect to get a syntax error at all, but I don’t understand why it should be at line 8 when there is a similar if-else construct prior to that of line 8. There are similar, subsequent constructs before a final return statement (which is a Zapier mechanism).

Tags : python zapier

Answers 1

Seems like a simple typo: The last character on this line is not a tick ('), but an apostrophe ():

office = 'N.A.’
August 14, 2019 05:24 AM

Related Questions

Simple split string not working in zapier

Updated August 01, 2017 02:26 AM

Empty string python zapier

Updated April 01, 2019 12:26 PM