<?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 Calculate Value in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-value/m-p/1228676#M61892</link>
    <description>&lt;P&gt;I want to create a tool which be capable to read the feature's name with python's&amp;nbsp;expression so I add Parse Path to the feature and add the Calculate Value tool in model builder flow with this command line.&lt;/P&gt;&lt;P&gt;Expression: Name == '%Name%'&lt;/P&gt;&lt;P&gt;Code block:&lt;BR /&gt;import difflib&lt;BR /&gt;Name=='%Name%'&lt;BR /&gt;def funcao(Name):&lt;BR /&gt;n = 1&lt;BR /&gt;cutoff = 0.8&lt;BR /&gt;lista = ['hid', 'hidrography']&lt;BR /&gt;close_matches = difflib.get_close_matches(Name, lista, n, cutoff)&lt;BR /&gt;while len(close_matches)&amp;gt;=1:&lt;BR /&gt;return True&lt;BR /&gt;else:&lt;BR /&gt;return False&lt;/P&gt;&lt;P&gt;Although the syntax is correct, the expression doesn't work because the result value is not what I want.&lt;/P&gt;&lt;P&gt;My desire was after this Calculate Value results the correct value i will link to If Value is (Value test) and then it would be possible branching the process.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Any suggestions and corrections are welcome!&lt;/P&gt;</description>
    <pubDate>Fri, 04 Nov 2022 12:01:00 GMT</pubDate>
    <dc:creator>ammsgis</dc:creator>
    <dc:date>2022-11-04T12:01:00Z</dc:date>
    <item>
      <title>Calculate Value</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-value/m-p/1228676#M61892</link>
      <description>&lt;P&gt;I want to create a tool which be capable to read the feature's name with python's&amp;nbsp;expression so I add Parse Path to the feature and add the Calculate Value tool in model builder flow with this command line.&lt;/P&gt;&lt;P&gt;Expression: Name == '%Name%'&lt;/P&gt;&lt;P&gt;Code block:&lt;BR /&gt;import difflib&lt;BR /&gt;Name=='%Name%'&lt;BR /&gt;def funcao(Name):&lt;BR /&gt;n = 1&lt;BR /&gt;cutoff = 0.8&lt;BR /&gt;lista = ['hid', 'hidrography']&lt;BR /&gt;close_matches = difflib.get_close_matches(Name, lista, n, cutoff)&lt;BR /&gt;while len(close_matches)&amp;gt;=1:&lt;BR /&gt;return True&lt;BR /&gt;else:&lt;BR /&gt;return False&lt;/P&gt;&lt;P&gt;Although the syntax is correct, the expression doesn't work because the result value is not what I want.&lt;/P&gt;&lt;P&gt;My desire was after this Calculate Value results the correct value i will link to If Value is (Value test) and then it would be possible branching the process.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Any suggestions and corrections are welcome!&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 12:01:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-value/m-p/1228676#M61892</guid>
      <dc:creator>ammsgis</dc:creator>
      <dc:date>2022-11-04T12:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Value</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-value/m-p/1228865#M61913</link>
      <description>&lt;P&gt;Hard to decipher what you are tyring to do without proper &lt;A href="https://community.esri.com/t5/python-blog/code-formatting-the-community-version/ba-p/1007633" target="_self"&gt;code formatting.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;One thing that is obvious righ away is that you are not running the function.&amp;nbsp; The expression line is where you call the code block function:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;funcao(!FieldName!)&lt;/LI-CODE&gt;&lt;P&gt;Maybe check out some of the examples &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/calculate-field-examples.htm" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 18:55:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-value/m-p/1228865#M61913</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2022-11-04T18:55:24Z</dc:date>
    </item>
  </channel>
</rss>

