2

I'm not the best with using the field calculator of ArcMap and I'm unsure of what's wrong with my VBScript

Basically the new column needs to contain data pulled from the same row in the following format "Name": Streetname-ObjectID

In case it's not clear, the result should be prefaced by the word "Name" and then be populated with the name from the street column, a hyphen, then the corresponding ObjectID.

This is what I've been trying to run more or less, but the VB Script parser won't take it:

'Name': [name] & '_' & [OBJECTID] 
2
  • Thanks I got it to work!
    – richie
    Commented Sep 27, 2019 at 14:49
  • 1
    I see that you have a fix so this is just a general comment: What version of ArcMap are you using? You might want to start learning the Python options for Field Calculator instead of VBScript, as VBScript Parser isn't included in ArcGIS Pro.
    – SMiller
    Commented Sep 27, 2019 at 16:14

1 Answer 1

1

Use double-quote mark " instead of single-quote ' around your text, and put the colon : inside the quote. Also you're missing an ampersand & between "Name:" and [name]

"Name:" & [name] & "_" & [OBJECTID]

Single-quote marks in Visual Basic (which VBScript is derived from) signifies a comment, so the parser ignores all text after the single-quote.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.