<?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: Define data type when using calculate field in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016979#M36015</link>
    <description>&lt;P&gt;So this appears to be more of a Model Builder issue than a Calculate Field issue.&lt;/P&gt;&lt;P&gt;In terms of Model Builder and an intermediate data source, I am guessing Model Builder isn't allowing the option because it has no idea what the schema will look like when the model is run.&amp;nbsp; When you are pointing to an existing/original data set, Model Builder can lookup the schema of the data set and determine what fields do and don't exist, and hence give you the option to create a new field and set the data type.&amp;nbsp; When working with intermediate data, it is derived and the schema won't be known until runtime so Model Builder isn't allowing that parameter to be set.&lt;/P&gt;</description>
    <pubDate>Thu, 14 Jan 2021 18:01:01 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2021-01-14T18:01:01Z</dc:date>
    <item>
      <title>Define data type when using calculate field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016893#M35992</link>
      <description>&lt;P&gt;I'm using ArcGIS pro 2.7 and building a model that uses the "Calculate field" tool. I'd like the field to be a new field and it needs to be of the data type "double".&lt;/P&gt;&lt;P&gt;When inputting the parameters there is no option to select data type of the output field. The &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/calculate-field.htm" target="_self"&gt;documentation&lt;/A&gt; says this is an optional parameter. However, where and how should this be entered into the dialog box?&lt;/P&gt;&lt;P&gt;Below is an example of what I have so far (calculating area in hectares). Currently this creates the output field as "text" data type.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="OliverBurdekin2_0-1610639303835.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/3886iF9161391603C4BFE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="OliverBurdekin2_0-1610639303835.png" alt="OliverBurdekin2_0-1610639303835.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Oliver&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 15:52:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016893#M35992</guid>
      <dc:creator>Oliver_Burdekin</dc:creator>
      <dc:date>2021-01-14T15:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: Define data type when using calculate field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016905#M35995</link>
      <description>&lt;P&gt;Oliver - what I would do is &lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/create-modify-and-delete-fields.htm" target="_self"&gt;create a new field&lt;/A&gt; and make it a DOUBLE.&amp;nbsp; One the field exists, then you can run the Calculate Field geoprocessing tool.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 16:13:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016905#M35995</guid>
      <dc:creator>Robert_LeClair</dc:creator>
      <dc:date>2021-01-14T16:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: Define data type when using calculate field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016908#M35996</link>
      <description>&lt;P&gt;Thanks Robert. I was looking at that as a workaround. Is there no way to add optional arguments through the codeblock?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 16:16:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016908#M35996</guid>
      <dc:creator>Oliver_Burdekin</dc:creator>
      <dc:date>2021-01-14T16:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: Define data type when using calculate field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016911#M35997</link>
      <description>&lt;P&gt;You're welcome Oliver - not sure about adding optional arguments in the codeblock as I have not done that workflow.&amp;nbsp; I'll do some digging around and get back to you.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 16:19:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016911#M35997</guid>
      <dc:creator>Robert_LeClair</dc:creator>
      <dc:date>2021-01-14T16:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: Define data type when using calculate field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016912#M35998</link>
      <description>&lt;P&gt;The tool should then add a new dropdown of field type if its not in the table.&amp;nbsp; I hate to ask, but does the field name already exist in the table?&amp;nbsp; Also what is the error icon beside the field?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 16:23:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016912#M35998</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2021-01-14T16:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: Define data type when using calculate field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016916#M35999</link>
      <description>&lt;P&gt;If memory serves this produces the field and allows you to do a calculation at once.&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/calculate-fields.htm" target="_blank"&gt;Calculate Fields (multiple) (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Even though it says "multiple" that includes one.&amp;nbsp; The data type is determined from the calculation&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 16:27:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016916#M35999</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-01-14T16:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: Define data type when using calculate field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016919#M36000</link>
      <description>&lt;P&gt;I got it to work NOT using the CodeBlock - see attached image.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="calcfield.JPG" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/3892i688EDDA342C15B6B/image-size/large?v=v2&amp;amp;px=999" role="button" title="calcfield.JPG" alt="calcfield.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 16:29:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016919#M36000</guid>
      <dc:creator>Robert_LeClair</dc:creator>
      <dc:date>2021-01-14T16:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: Define data type when using calculate field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016933#M36003</link>
      <description>&lt;P&gt;Thanks Robert,&lt;/P&gt;&lt;P&gt;I'm not getting the same behaviour. I'm on ArcPro 2.7 and using the tool within modelbuilder. But as you can see the "Field Type" setting is not appearing.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="OliverBurdekin2_0-1610642937221.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/3896i97B08C9A31A90D92/image-size/medium?v=v2&amp;amp;px=400" role="button" title="OliverBurdekin2_0-1610642937221.png" alt="OliverBurdekin2_0-1610642937221.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The yellow warning next to field name is to inform me that the field doesn't exist and will be created.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;However&lt;/STRONG&gt;, I just tried it with the original input (not intermediate data) and that dropdown does appear. So it would seem for intermediate data the "add field" tool would need to be run first.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 16:54:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016933#M36003</guid>
      <dc:creator>Oliver_Burdekin</dc:creator>
      <dc:date>2021-01-14T16:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: Define data type when using calculate field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016935#M36004</link>
      <description>&lt;P&gt;Thanks David, the new dropdown is not appearing. The tool is being used in Modelbuilder and connected to an intermediate datasource. I've deleted all intermediate data and the yellow warning is to inform me that the field does not exist.&lt;/P&gt;&lt;P&gt;On further testing the dropdown doesn't appear when using the tool on intermediate data within Modelbuilder. It does appear if I use it on the original input feature class.&lt;BR /&gt;The workaround for intermediate data is to use the "add field" tool first within the model and then "calculate field"&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 16:56:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016935#M36004</guid>
      <dc:creator>Oliver_Burdekin</dc:creator>
      <dc:date>2021-01-14T16:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: Define data type when using calculate field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016937#M36005</link>
      <description>&lt;P&gt;field type is determined by what is calculated, you don't need to specify it.&amp;nbsp; If you need a double/float and you are afraid of getting an integer, multiply the calculation by... 1.0&amp;nbsp; &amp;nbsp;.... it will become double/float aka 64 bit floating point&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 16:53:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016937#M36005</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-01-14T16:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: Define data type when using calculate field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016959#M36009</link>
      <description>&lt;P&gt;Thanks Dan,&lt;/P&gt;&lt;P&gt;I expected the field type to be determined by what is calculated but that doesn't seem to be happening. The expression I'm using is&lt;BR /&gt;&lt;BR /&gt;!Shape.area@hectares!&lt;/P&gt;&lt;P&gt;Here's a gif of the the tool not providing the second dropdown (as per Robert's answer) and creating a text field when a double or float would be expected.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dPatterson.gif" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/3898i3B1692E7A9297B3A/image-size/large?v=v2&amp;amp;px=999" role="button" title="dPatterson.gif" alt="dPatterson.gif" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 17:15:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016959#M36009</guid>
      <dc:creator>Oliver_Burdekin</dc:creator>
      <dc:date>2021-01-14T17:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: Define data type when using calculate field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016965#M36010</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="calc.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/3899i61E80FC31EC456EF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="calc.png" alt="calc.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Pro 2.7...&amp;nbsp; &amp;nbsp;Maybe try moving your model to a conventional python script tool&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 17:30:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016965#M36010</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-01-14T17:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: Define data type when using calculate field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016974#M36013</link>
      <description>&lt;P&gt;Thanks Dan,&lt;/P&gt;&lt;P&gt;I'm not sure how to do that. Would that be a .pyt&amp;nbsp; toolbox? Having looked at the .pyt it's not really the desired workflow as I was hoping to use ModelBuilder for non-coders.&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Oliver&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 17:50:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016974#M36013</guid>
      <dc:creator>Oliver_Burdekin</dc:creator>
      <dc:date>2021-01-14T17:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: Define data type when using calculate field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016977#M36014</link>
      <description>&lt;P&gt;not the pyt&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/geoprocessing_and_python/a-quick-tour-of-creating-script-tools.htm" target="_blank"&gt;What is a script tool?—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can establish your parameters through a dialog... much easier for the novice&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 17:57:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016977#M36014</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-01-14T17:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: Define data type when using calculate field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016979#M36015</link>
      <description>&lt;P&gt;So this appears to be more of a Model Builder issue than a Calculate Field issue.&lt;/P&gt;&lt;P&gt;In terms of Model Builder and an intermediate data source, I am guessing Model Builder isn't allowing the option because it has no idea what the schema will look like when the model is run.&amp;nbsp; When you are pointing to an existing/original data set, Model Builder can lookup the schema of the data set and determine what fields do and don't exist, and hence give you the option to create a new field and set the data type.&amp;nbsp; When working with intermediate data, it is derived and the schema won't be known until runtime so Model Builder isn't allowing that parameter to be set.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 18:01:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016979#M36015</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-01-14T18:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: Define data type when using calculate field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016983#M36017</link>
      <description>&lt;P&gt;Thanks Dan. I think it might be easier to include the "add field" as a work around in the original model.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 18:08:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016983#M36017</guid>
      <dc:creator>Oliver_Burdekin</dc:creator>
      <dc:date>2021-01-14T18:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: Define data type when using calculate field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016997#M36019</link>
      <description>&lt;P&gt;This makes a lot of sense. Thanks Joshua.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 18:29:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1016997#M36019</guid>
      <dc:creator>Oliver_Burdekin</dc:creator>
      <dc:date>2021-01-14T18:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: Define data type when using calculate field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1110698#M47127</link>
      <description>&lt;P&gt;I've got the same issue in Model Builder in Pro 2.8.2&lt;/P&gt;&lt;P&gt;I've found a workaround:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;create the Calculate field in Pro&lt;/LI&gt;&lt;LI&gt;run it once and&lt;/LI&gt;&lt;LI&gt;drag it into your model from the GP history tab.&lt;/LI&gt;&lt;LI&gt;reconfigure to your model.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;is this a bug?? Has it been submitted?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 05:53:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1110698#M47127</guid>
      <dc:creator>GrahamWood-HWC</dc:creator>
      <dc:date>2021-10-25T05:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: Define data type when using calculate field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1410585#M81919</link>
      <description>&lt;P&gt;Same issue with Python the Field Type seems to vanish as a selection. I switch to Arcade which has helped.&lt;/P&gt;&lt;P&gt;For your distinct issue, I&amp;nbsp;used Add Field so that I can be specific of the Field Name, Field Alias, and Type, before I ran the next Calculate Field.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DanielGamboa_1-1713297788032.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/101125iF3C9A08BC51289C5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DanielGamboa_1-1713297788032.png" alt="DanielGamboa_1-1713297788032.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2024 20:16:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1410585#M81919</guid>
      <dc:creator>DanielGamboa</dc:creator>
      <dc:date>2024-04-16T20:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: Define data type when using calculate field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1476123#M83530</link>
      <description>&lt;P&gt;This would help to change data type in model field calculator by adding field type as parameter of your Field Calculator tool.&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 524px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/104727i14055BFB7E97E4F2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 09:04:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/define-data-type-when-using-calculate-field/m-p/1476123#M83530</guid>
      <dc:creator>LaVokas</dc:creator>
      <dc:date>2024-05-21T09:04:06Z</dc:date>
    </item>
  </channel>
</rss>

