1

I am using ArcGIS ModelBuilder.

I want to use Field Calculator to put the file name into a field. I created a field using add field. But I don't know the function to call the file name. What I've tried is "!name!", "!file.name!".

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked May 17, 2022 at 9:36
2
  • Are you using the ModelBuilder of ArcGIS Pro or the one from ArcMap? Commented May 17, 2022 at 10:55
  • There is no means within a Cursor object or Field Calculator tool to determine the data set/source name that is being processed, that information needs to be determined outside a Cursor object or Field Calculator and passed to it. Commented May 17, 2022 at 18:20

1 Answer 1

1

Try the Parse Path model builder tool.

You can also use arcpy.describe. The Describe Object Properties returns the path which you can field calculate into your attribute table.

answered May 17, 2022 at 15:37

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.