I am trying to use inline variable substitution in ModelBuilder to return the name of a raster used in Zonal Statistics as a field in my output table (see model below).

Currently, the model works fine using the "%Raster Dataset%" to get the field I want, but it returns the FULL file path - e.g. C/Users/Newton/GIS/Project/RASTER123 instead of just "RASTER123". Anyone know how to just select the name of the input raster, not the full path?

enter image description here

1 Answer 1


With some help from colleagues and lots of googling I found the answer.

If you choose "Insert" --> Model only tools --> Parse Path, and connect the Raster Dataset to this, choose Parse type = Name, and Rename the "Value" output from the ParsePath tool to "RasterName", you will get JUST the Raster name if you change the expression (blue, in jpeg above) to "%RasterName%".

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.