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' else: workbench = 'N.A.' if input_data.['office'] == 'True': office = 'False' else: 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).
Seems like a simple typo: The last character on this line is not a tick (
'), but an apostrophe (
office = 'N.A.’