I'm building a bike network dataset based on an existing street network. Each bike lane/route/path has a unique ID number (assigned by our engineering deparment) that must be included in a separate ID field within each feature class. We recently changed the base for our street network, necessitating a redraw of about 4000 segments.
To save time manually adding fields, I built a model to add the new ID field "BPID" (which must be saved as a short integer), a "BPID_Temp" field, used to convert the string values to numbers by trimming the leading character (expression is =Right( [BPID_TEMP], Len( [BPID_TEMP] )-1 ) and then copying it to the permanent BPID field. Lastly, I delete the temporary ID field.
Here is an image of the model below:
At the first Calculate Field step, the value from Parse Path is not being transferred into the BPID_TEMP field. The expression for the step is "Value", in PYTHON. Parse Path is set to NAME, and the model runs through without throwing any errors.
I've gone through Using Feature Class "Name" from Iterate Feature Classes to Calculate Field with ModelBuilder?. However, adding wildcards to the "Value" expression returns an invalid expression error. If I link the "Value" output from Parse Path directly into the Calculate Field (rather than as a precondition), it tells me that I am trying to calculate a number that is too large, or mixing incompatible data types.
Am i missing something critical here. I can run the steps manually no problem, but as soon as I try to automate with an iterator, it all falls apart. I'm not great with Python yet, but I feel like it isn't even necessary here.