<?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: ArcGIS Pro Calculate Field Using Python - Return String if Field is Null not working in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-calculate-field-using-python-return/m-p/1619318#M96166</link>
    <description>&lt;P&gt;Your expression for the above code block would need to be:&lt;BR /&gt;&lt;BR /&gt;RampQA(!ramp_type!)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 29 May 2025 16:32:38 GMT</pubDate>
    <dc:creator>RichardHowe</dc:creator>
    <dc:date>2025-05-29T16:32:38Z</dc:date>
    <item>
      <title>ArcGIS Pro Calculate Field Using Python - Return String if Field is Null not working</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-calculate-field-using-python-return/m-p/1619301#M96163</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;def&lt;/SPAN&gt; &lt;SPAN&gt;RampQA&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ramp_type&lt;/SPAN&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;ramp_type is None&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;"Ramp type is blank"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This hasnt worked, but feels like it should be simple... "ramp_type" is a string field. This calculation would return an error in a completely different field. Instead of returning "Ramp type is blank" it just returns Null in that field and results in this warning message:&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;WARNING 002858: Certain rows set to NULL due to error while evaluating python expression: File "&amp;lt;string&amp;gt;", line **, in RampQA&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 29 May 2025 15:47:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-calculate-field-using-python-return/m-p/1619301#M96163</guid>
      <dc:creator>SaranehSFitzgerald</dc:creator>
      <dc:date>2025-05-29T15:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Calculate Field Using Python - Return String if Field is Null not working</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-calculate-field-using-python-return/m-p/1619306#M96164</link>
      <description>&lt;P&gt;Can you post a screengrab of the expression and codeblock from Pro?&amp;nbsp; Also your text got formatted into an emoji.&lt;/P&gt;</description>
      <pubDate>Thu, 29 May 2025 15:55:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-calculate-field-using-python-return/m-p/1619306#M96164</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2025-05-29T15:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Calculate Field Using Python - Return String if Field is Null not working</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-calculate-field-using-python-return/m-p/1619308#M96165</link>
      <description>&lt;P&gt;Are the values Null, an empty string (""), or a space (" ")?&lt;/P&gt;</description>
      <pubDate>Thu, 29 May 2025 16:00:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-calculate-field-using-python-return/m-p/1619308#M96165</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2025-05-29T16:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Calculate Field Using Python - Return String if Field is Null not working</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-calculate-field-using-python-return/m-p/1619318#M96166</link>
      <description>&lt;P&gt;Your expression for the above code block would need to be:&lt;BR /&gt;&lt;BR /&gt;RampQA(!ramp_type!)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 May 2025 16:32:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-calculate-field-using-python-return/m-p/1619318#M96166</guid>
      <dc:creator>RichardHowe</dc:creator>
      <dc:date>2025-05-29T16:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Calculate Field Using Python - Return String if Field is Null not working</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-calculate-field-using-python-return/m-p/1619345#M96169</link>
      <description>&lt;P&gt;This is likely the root. Trying to verify "blank" values in field calculator is a mess.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 May 2025 17:17:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-calculate-field-using-python-return/m-p/1619345#M96169</guid>
      <dc:creator>AustinAverill</dc:creator>
      <dc:date>2025-05-29T17:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Calculate Field Using Python - Return String if Field is Null not working</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-calculate-field-using-python-return/m-p/1619371#M96171</link>
      <description>&lt;P&gt;You don't even need a code block for this, a Python&amp;nbsp;&lt;A href="https://docs.python.org/3/reference/expressions.html#conditional-expressions" target="_self"&gt;6.13. Conditional expressions&amp;nbsp;&lt;/A&gt;in the expression block will do the trick:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;"Ramp type is blank" if !ramp_type! is None else !ramp_type!&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 29 May 2025 18:04:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-calculate-field-using-python-return/m-p/1619371#M96171</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2025-05-29T18:04:17Z</dc:date>
    </item>
  </channel>
</rss>

