We are attempting to do a simple if/else statement for labeling on a project but keep coming up with an error. The code is as follows:
def FindLabel ([Name], [Type]):
if [Type]= 'Church':
return "Church"
else:
return "Not Church"
The error that we are getting is as follows:
Invalid Expression
Error 0 on line 0
File "<string>", line 2
if esri_1 = 'Church':
^
SyntaxError: invalid syntax
We also worked on arcade (New to us). Here is that code:
if DomainName($feature, 'Type' ="Church") {
return $feature.Name
}
else {
return "Not Church"
}
We get the following error:
Invalid Expression
Error on line 1
Open parenthesis expected.
Any help will be greatly appreciated!
Chris Goessl & Justin Fowler
City of Kettering
Solved! Go to Solution.
Hi Chris,
For the python portion, when you check if something is equal to, you will want to specify two equal signs (==). Ex:
def FindLabel ([Name], [Type]):
if [Type]== 'Church':
return "Church"
else:
return "Not Church"
Hi Chris,
For the python portion, when you check if something is equal to, you will want to specify two equal signs (==). Ex:
def FindLabel ([Name], [Type]):
if [Type]== 'Church':
return "Church"
else:
return "Not Church"
ohhhhhhh.... I completely FORGOT about that. That's what happens when you switch between four different computer languages.