Hello,
In modelbuilder, I am trying to create a text field that will contain the first five characters of a feature class name. The model is as follows:
The adding of the field runs okay for each feature class that needs it, but the calculate field fails to populate the field with the leftmost five characters - the field remains empty. Here is the Calculate Field parameters:
Perhaps my VBscript code is off, yet no errors are thrown. I end up with empty SID fields for each feature class needing them populated with the leftmost 5 characters.
Solved! Go to Solution.
You need to use a string literal. Try this, VBScript will see something like: Left("test_poly", 5) at runtime:
Left("%Name%", 5)
or better yet, use the Python parser
"%Name%"[:5]
You need to use a string literal. Try this, VBScript will see something like: Left("test_poly", 5) at runtime:
Left("%Name%", 5)
or better yet, use the Python parser
"%Name%"[:5]