I'm trying to populate a field (AVO) using this statement
AVO =
dim avo
if [join] = 1 then AVO = "YES"
It works if I do it in ArcMap but it doesn't when I use the same syntax in ModelBuilder.
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.
Sign up to join this communityI'm trying to populate a field (AVO) using this statement
AVO =
dim avo
if [join] = 1 then AVO = "YES"
It works if I do it in ArcMap but it doesn't when I use the same syntax in ModelBuilder.
I don't know exactly how you are typing in your code, but my first assumption is if it works in one spot but not the other to check that the parser (VB vs Python) is set correctly and the same way in both places. Second, of course I don't know what specifically your workflow looks like in either spot, but it might be worth double checking in modelbuilder that the exact same dataset and schema is actually being used EX: If there is a step in the model before it that deletes a field or if there is an actual join performed at some point, that could change if the code is valid (if there is a join performed in the model, the field names may need to be stated differently, possibly including the source table name for each field for example).
These may or may not be your specific issue, but there's a couple of thoughts to hopefully get you going.