<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Use inline variable subsitution to set INPUT data path and name in model builder in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/use-inline-variable-subsitution-to-set-input-data/m-p/509875#M16966</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Marcin and Curtis, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your reply. Sorry I have been away from work, so could not respond earlier. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried both your suggestions, but still got the same error. Please see the attached JEPG.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I suspect the problem is: %Name% is not recognized as inline variable substitution, but just a series of characters. I tested by keeping %InputWorkspace% in the input window, but use an existing layer file name. The model ran no problem. But once I used %Name%.lyr to replace the existing layer file name, I got the same error. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think the potential reason is: Inline variable substitution is designed for elements going along the flow of the model, instead of an element (symbology layer variable in this case) appearing half-way in the model and use inline variable substitution for input.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I on the right track?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks heaps for your input.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Christina&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Dec 2012 02:23:12 GMT</pubDate>
    <dc:creator>ChristinaLi</dc:creator>
    <dc:date>2012-12-05T02:23:12Z</dc:date>
    <item>
      <title>Use inline variable subsitution to set INPUT data path and name in model builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/use-inline-variable-subsitution-to-set-input-data/m-p/509872#M16963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is it possible to use inline variable subsitution to set the INPUT path and name of layers which are needed in the second half of a model? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please see the attached model. What I want to do is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. For each feature class in the workpace, I want to select the features intersecting with the area of interest, then export them to a new feature class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. I want to apply existing symbology layers of the original feature class to each of the new feature class respectively. I make sure the symbology layers has the SAME NAME as the original feature class. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Package the new feature class and the symbology layer into a layer package, so that I can distribute the data with symbology to other people&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I set the path and name of the symbology layer variable to be:&amp;nbsp;&amp;nbsp; %workspace%\%Name%.lyr&amp;nbsp;&amp;nbsp; , assuming that all the values of Name variable in earlier part of the model can be picked up here one by one. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But I got ERROR 000732: symbology layer: Dataset %Workspace%\%Name%.lyr does not exist or is not supported&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I on the right track? Can I use inline variable substitution for INPUT path and names, instead of the usual OUTPUT path and name? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Your help is much appreciated!!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Christina Li&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Spatial Analyst&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Gold Coast City Council&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Queensland, Australia&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Nov 2012 04:12:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/use-inline-variable-subsitution-to-set-input-data/m-p/509872#M16963</guid>
      <dc:creator>ChristinaLi</dc:creator>
      <dc:date>2012-11-23T04:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: Use inline variable subsitution to set INPUT data path and name in model builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/use-inline-variable-subsitution-to-set-input-data/m-p/509873#M16964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When you use &lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;"&gt;%Workspace%&lt;/SPAN&gt;&lt;SPAN&gt; inline variable, it refers to Current Workspace variable from Environmets settings.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What you can do is to set Current Workspace environment setting equal your &lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;"&gt;Workspace &lt;/SPAN&gt;&lt;SPAN&gt;inline variable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Second and more straightforward way is to rename &lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;"&gt;Workspace &lt;/SPAN&gt;&lt;SPAN&gt;inline variable to eg. &lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;"&gt;InputWorkspace &lt;/SPAN&gt;&lt;SPAN&gt;and use this name layer path:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family:Courier New;"&gt;%InputWorkspace%\%Name%.lyr&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Nov 2012 06:14:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/use-inline-variable-subsitution-to-set-input-data/m-p/509873#M16964</guid>
      <dc:creator>MarcinGasior</dc:creator>
      <dc:date>2012-11-23T06:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: Use inline variable subsitution to set INPUT data path and name in model builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/use-inline-variable-subsitution-to-set-input-data/m-p/509874#M16965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I set the path and name of the symbology layer variable to be:&amp;nbsp;&amp;nbsp; %workspace%\%Name%.lyr&amp;nbsp;&amp;nbsp; , assuming that all the values of Name variable in earlier part of the model can be picked up here one by one.&amp;nbsp; &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One more thing, use preconditions to make sure the tools run in the order needed to make paths valid at runtime.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Nov 2012 14:47:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/use-inline-variable-subsitution-to-set-input-data/m-p/509874#M16965</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2012-11-26T14:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: Use inline variable subsitution to set INPUT data path and name in model builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/use-inline-variable-subsitution-to-set-input-data/m-p/509875#M16966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Marcin and Curtis, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your reply. Sorry I have been away from work, so could not respond earlier. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried both your suggestions, but still got the same error. Please see the attached JEPG.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I suspect the problem is: %Name% is not recognized as inline variable substitution, but just a series of characters. I tested by keeping %InputWorkspace% in the input window, but use an existing layer file name. The model ran no problem. But once I used %Name%.lyr to replace the existing layer file name, I got the same error. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think the potential reason is: Inline variable substitution is designed for elements going along the flow of the model, instead of an element (symbology layer variable in this case) appearing half-way in the model and use inline variable substitution for input.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I on the right track?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks heaps for your input.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Christina&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 02:23:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/use-inline-variable-subsitution-to-set-input-data/m-p/509875#M16966</guid>
      <dc:creator>ChristinaLi</dc:creator>
      <dc:date>2012-12-05T02:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: Use inline variable subsitution to set INPUT data path and name in model builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/use-inline-variable-subsitution-to-set-input-data/m-p/509876#M16967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ok I see what you are doing based on your first attachment on this forum. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG style="text-decoration: underline;"&gt;Explanation:&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think you are trying to run this model from the model tool dialog, Correct?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;If yes, your layer file connected as input to the Apply Symbology from Layer tool has the value %workspace%\%Name%.lyr...&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Now, when you run a model from its tool dialog and have %Workspace% in any of your parameter it is going to look at for the current workspace set in the environment settings at the ArcMap level i.e. set from the Geoprocessing tab on ArcMap&amp;gt;environments option . The workspace set here must match the workspace you really want to point to find the layer. This means that you need a map document with a set current workspace to always accompany the model when you share your model. &lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;OR if you do not want a map document to be shared and if you decide to you a default workspace in the environments setting set at ArcMap level then this default workspace will not have the layer file you are pointing at. &lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Now the second part %Name%.. this Name really points to a variable in the model. When you run it as a model tool this %Name% will not work.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;BR /&gt;&lt;STRONG style="text-decoration: underline;"&gt;Testing:&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you running the model from within a model and still see this error check these things to begin:&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;%Workspace% which points to the workspace variable connected to your iterator is the folder that contains your layer file.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Check the value of the variable Name (output of the iterator) to which the %Name% is pointing at, and make sure the value of the variable and the name of the layer in the workspace are exactly the same. &lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;BR /&gt;&lt;SPAN&gt;If the above two points are OK then try this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;Instead of the %Workspace% use the actual path to the workspace and then append %Name%.lyr in the end. &lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;If this fails try to use the exact layer file name and path and run the model for just one feature class and its&amp;nbsp; corresponding layer file.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt; Do you really need the input to Apply Symbology From Layer tool as a model parameter? &lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;SPAN&gt;[INDENT][/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If nothing works write back and share your model and a sample of your data and the layer file.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 23:06:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/use-inline-variable-subsitution-to-set-input-data/m-p/509876#M16967</guid>
      <dc:creator>ShitijMehta</dc:creator>
      <dc:date>2012-12-05T23:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: Use inline variable subsitution to set INPUT data path and name in model builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/use-inline-variable-subsitution-to-set-input-data/m-p/509877#M16968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN style="color:&amp;quot;#0000FF&amp;quot;;"&gt;Hi shitij mehta,&lt;BR /&gt;&lt;BR /&gt;Thank you very much for the detailed explanation and testing steps!&lt;BR /&gt;&lt;BR /&gt;But the model still did not work after I followed every step you laid out. The model did not run from the model tool dialogue, or from within a model. I then followed the two steps below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; â?¢Instead of the %Workspace% use the actual path to the workspace and then append %Name%.lyr in the end.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN style="color:&amp;quot;#0000FF&amp;quot;;"&gt;The %Name% part triggered the error in &lt;SPAN style="color:&amp;quot;#FF0000&amp;quot;;"&gt;attachment 1&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; â?¢If this fails try to use the exact layer file name and path and run the model for just one feature class and its corresponding layer file.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN style="color:&amp;quot;#0000FF&amp;quot;;"&gt;Worked.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color:&amp;quot;#0000FF&amp;quot;;"&gt;So I believe the problem is:&lt;BR /&gt;%Name% is not recognized as an inline variable substitution, but just a bunch of strings.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; â?¢Do you really need the input to Apply Symbology From Layer tool as a model parameter? &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN style="color:&amp;quot;#0000FF&amp;quot;;"&gt;Not really, so I unchecked the model parameter option. But the model still did not run.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color:&amp;quot;#0000FF&amp;quot;;"&gt;I also tried to use â??Calculate Valueâ?� to construct the exact name of the symbology layer by adding the value from Name variable with extension â??.lyrâ?�. I managed to get the output string (exact symbology layer name) no problem. But %SymbologyLayerName% still cannot be recognized by Apply Symbology From Layer. (Please see &lt;SPAN style="color:&amp;quot;#FF0000&amp;quot;;"&gt;attachment 2&lt;/SPAN&gt;) &lt;BR /&gt;&lt;BR /&gt;So, I have included the models, two feature classes and their corresponding symbology layers in the &lt;SPAN style="color:&amp;quot;#FF0000&amp;quot;;"&gt;attached zip file&lt;/SPAN&gt;. Please refer to the &lt;SPAN style="color:&amp;quot;#FF0000&amp;quot;;"&gt;last attachment &lt;/SPAN&gt;"database structure environment setting.JPEG" when you unzip the files to your local drive.&lt;BR /&gt;&lt;BR /&gt;Can you please take a look and let me know if there is a solution, or I have to resort to Python codes (which I am not familiar with). Thank you so much for your help! &lt;BR /&gt;&lt;BR /&gt;Christina&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Dec 2012 05:02:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/use-inline-variable-subsitution-to-set-input-data/m-p/509877#M16968</guid>
      <dc:creator>ChristinaLi</dc:creator>
      <dc:date>2012-12-12T05:02:55Z</dc:date>
    </item>
  </channel>
</rss>

