<?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: ModelBuilder Inline Variable Sub coming out as literal in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/modelbuilder-inline-variable-sub-coming-out-as/m-p/397860#M17664</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I get literal %'s when&amp;nbsp;I mis-spell the variable name.&amp;nbsp; No idea why %n% wouldn't work; I just verified in 2.2.1 for me and variable substitution is working fine.&lt;/P&gt;&lt;P&gt;Sometimes you need to set the variable as a precondition to the tool that is creating the path you are specifying with that variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data type should not matter, as long as the value itself is a string. You can create a datetime string for the current date with this expression in Calculate Value:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# Expression: &lt;/SPAN&gt;
datetime&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;datetime&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;now&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;strftime&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"%Y-%m-%d"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# Code Block:&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; datetime&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 18:11:13 GMT</pubDate>
    <dc:creator>curtvprice</dc:creator>
    <dc:date>2021-12-11T18:11:13Z</dc:date>
    <item>
      <title>ModelBuilder Inline Variable Sub coming out as literal</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/modelbuilder-inline-variable-sub-coming-out-as/m-p/397859#M17663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My model will be run on successive days and I want a month and date to be appended to the end. I'm using a parameter&amp;nbsp;&amp;nbsp;In my frustration to get this to work, I created a model variable,&amp;nbsp; (tried string, variant and 'any value' for the data type and made&amp;nbsp;each a parameter.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is that inline variable substitution comes out as the literal input. For example "CombinedData_%StrDa%"&amp;nbsp;&lt;/P&gt;&lt;P&gt;StrDa is the name of the variable. Instead of substituting %StrDa% for its value, &lt;SPAN&gt;CombinedData_%StrDa%" is the name of the shapefile. I even tried %n% and it comes out as CombinedData_%n%&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I've browsed and searched for the answer, but I haven't found anything. I'm running ArcGIS Pro 2.2.1&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2018 23:07:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/modelbuilder-inline-variable-sub-coming-out-as/m-p/397859#M17663</guid>
      <dc:creator>GabrielMarcus</dc:creator>
      <dc:date>2018-08-06T23:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: ModelBuilder Inline Variable Sub coming out as literal</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/modelbuilder-inline-variable-sub-coming-out-as/m-p/397860#M17664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I get literal %'s when&amp;nbsp;I mis-spell the variable name.&amp;nbsp; No idea why %n% wouldn't work; I just verified in 2.2.1 for me and variable substitution is working fine.&lt;/P&gt;&lt;P&gt;Sometimes you need to set the variable as a precondition to the tool that is creating the path you are specifying with that variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data type should not matter, as long as the value itself is a string. You can create a datetime string for the current date with this expression in Calculate Value:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# Expression: &lt;/SPAN&gt;
datetime&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;datetime&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;now&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;strftime&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"%Y-%m-%d"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# Code Block:&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; datetime&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:11:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/modelbuilder-inline-variable-sub-coming-out-as/m-p/397860#M17664</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-11T18:11:13Z</dc:date>
    </item>
  </channel>
</rss>

