I am creating a model that uses an iterator to iterate on layers in the map. When naming the outputs of the model, I would like to be able to use the layer name as it is set in the contents pane, rather than the file's name. This way the user can specify the output names in the contents pane before running the model.
E.g. The data's name in the gdb is "Project_SiteBound_v01_250120". In the contents this layer is named "SiteBoundary". Is there a way to ensure "SiteBoundary" is the name of the output?
I have tried using expressions to specify certain characters to give the name, but file names differ so much this doesn't work for every layer in the map.
Any help much appreciated, thank you!
Can you share more of your Model design etc? I would guess you've attempted %your variable name% but I'm not sure by what method you're extracting the layers from the map.
Hi, thanks for your reply. Screenshot of model attached. Yes I have tried the in line variable, but as the data I'm using tend to have long names, it's not possible on it's own. I have tried to use Calculate Value to specify bits of the layer's name e.g. middle 6 characters etc, but as each input has such a different name it's not possible to use the same rule for each layer being iterated. I'm extracting layers from the map using the Iterate Layers iterator. Ideally I'd like the user to be able to set the names of data in the contents, then these names get used in the model. Not sure if it's possible though!
Firstly that's a very well laid-out and annotated model.
Iterate Layers output should already be the layer name, how are you retrieving the full filename/path?
Default is an oval with 'Name' which will be the layer name as it appears in the map. I guess you've changed the name to FileName in the picture supplied. I also don't understand why FileName is set as a Parameter - it makes no sense to me. Maybe this is causing the issues.
I'd really recommend creating a new model for testing - and input a map with just 1 layer. Run it with just the Iterate Layers outputs and you'll probably see what's going on.