<?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 Python Api to connect to Utility network in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-to-connect-to-utility-network/m-p/1249004#M8284</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;&amp;nbsp;I want to update Utility network's feature class attributes for example "Notes columns".&lt;BR /&gt;Error :&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;---------------------------------------------------------------------------&lt;/SPAN&gt;
&lt;SPAN class=""&gt;Exception&lt;/SPAN&gt;                                 Traceback (most recent call last)
In  &lt;SPAN class=""&gt;[121]&lt;/SPAN&gt;:
Line &lt;SPAN class=""&gt;1&lt;/SPAN&gt;:     update_result = layer.edit_features(updates=[sfo_edit])

File &lt;SPAN class=""&gt;E:\Shared_fold\arcgispro-py3-cloneUN\Lib\site-packages\arcgis\features\layer.py&lt;/SPAN&gt;, in &lt;SPAN class=""&gt;edit_features&lt;/SPAN&gt;:
Line &lt;SPAN class=""&gt;2827&lt;/SPAN&gt;:  &lt;SPAN class=""&gt;return&lt;/SPAN&gt; &lt;SPAN class=""&gt;self&lt;/SPAN&gt;._con.post_multipart(path=edit_url, postdata=params)

File &lt;SPAN class=""&gt;E:\Shared_fold\arcgispro-py3-cloneUN\Lib\site-packages\arcgis\gis\_impl\_con\_connection.py&lt;/SPAN&gt;, in &lt;SPAN class=""&gt;post_multipart&lt;/SPAN&gt;:
Line &lt;SPAN class=""&gt;868&lt;/SPAN&gt;:   force_bytes=kwargs.pop(&lt;SPAN class=""&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;force_bytes&lt;/SPAN&gt;&lt;SPAN class=""&gt;"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;False&lt;/SPAN&gt;),

File &lt;SPAN class=""&gt;E:\Shared_fold\arcgispro-py3-cloneUN\Lib\site-packages\arcgis\gis\_impl\_con\_connection.py&lt;/SPAN&gt;, in &lt;SPAN class=""&gt;_handle_response&lt;/SPAN&gt;:
Line &lt;SPAN class=""&gt;625&lt;/SPAN&gt;:   &lt;SPAN class=""&gt;self&lt;/SPAN&gt;._handle_json_error(data[&lt;SPAN class=""&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;error&lt;/SPAN&gt;&lt;SPAN class=""&gt;"&lt;/SPAN&gt;], errorcode)

File &lt;SPAN class=""&gt;E:\Shared_fold\arcgispro-py3-cloneUN\Lib\site-packages\arcgis\gis\_impl\_con\_connection.py&lt;/SPAN&gt;, in &lt;SPAN class=""&gt;_handle_json_error&lt;/SPAN&gt;:
Line &lt;SPAN class=""&gt;648&lt;/SPAN&gt;:   &lt;SPAN class=""&gt;raise&lt;/SPAN&gt; &lt;SPAN class=""&gt;Exception&lt;/SPAN&gt;(errormessage)

&lt;SPAN class=""&gt;Exception&lt;/SPAN&gt;: Unable to complete operation.
Features that are utility network subnetwork controllers do not support edits to asset group or asset type attributes.
(Error Code: 400)
&lt;SPAN class=""&gt;---------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;BR /&gt;My code is :&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;from arcgis.features import FeatureLayer&lt;BR /&gt;lyr_url = '&lt;A href="https://abc.test1.com/server/rest/services/BCMCSJ3_5/FeatureServer/0" target="_blank" rel="noopener"&gt;https://abc.test1.com/server/rest/services/BCMCSJ3_5/FeatureServer/0&lt;/A&gt;'&lt;/P&gt;&lt;P&gt;layer = FeatureLayer(lyr_url)&lt;BR /&gt;ports_fset = layer.query()&lt;BR /&gt;ports_features = ports_fset.features&lt;BR /&gt;sfo_feature = [f for f in ports_features if f.attributes['OBJECTID']==3][0]&lt;BR /&gt;sfo_edit = sfo_feature&lt;BR /&gt;sfo_edit.attributes['NOTES2'] = 'RPN'&lt;BR /&gt;update_result = layer.edit_features(updates=[sfo_edit])&lt;/P&gt;</description>
    <pubDate>Wed, 18 Jan 2023 12:31:37 GMT</pubDate>
    <dc:creator>Rahul_Pandia</dc:creator>
    <dc:date>2023-01-18T12:31:37Z</dc:date>
    <item>
      <title>Python Api to connect to Utility network</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-to-connect-to-utility-network/m-p/1249004#M8284</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&amp;nbsp;I want to update Utility network's feature class attributes for example "Notes columns".&lt;BR /&gt;Error :&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;---------------------------------------------------------------------------&lt;/SPAN&gt;
&lt;SPAN class=""&gt;Exception&lt;/SPAN&gt;                                 Traceback (most recent call last)
In  &lt;SPAN class=""&gt;[121]&lt;/SPAN&gt;:
Line &lt;SPAN class=""&gt;1&lt;/SPAN&gt;:     update_result = layer.edit_features(updates=[sfo_edit])

File &lt;SPAN class=""&gt;E:\Shared_fold\arcgispro-py3-cloneUN\Lib\site-packages\arcgis\features\layer.py&lt;/SPAN&gt;, in &lt;SPAN class=""&gt;edit_features&lt;/SPAN&gt;:
Line &lt;SPAN class=""&gt;2827&lt;/SPAN&gt;:  &lt;SPAN class=""&gt;return&lt;/SPAN&gt; &lt;SPAN class=""&gt;self&lt;/SPAN&gt;._con.post_multipart(path=edit_url, postdata=params)

File &lt;SPAN class=""&gt;E:\Shared_fold\arcgispro-py3-cloneUN\Lib\site-packages\arcgis\gis\_impl\_con\_connection.py&lt;/SPAN&gt;, in &lt;SPAN class=""&gt;post_multipart&lt;/SPAN&gt;:
Line &lt;SPAN class=""&gt;868&lt;/SPAN&gt;:   force_bytes=kwargs.pop(&lt;SPAN class=""&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;force_bytes&lt;/SPAN&gt;&lt;SPAN class=""&gt;"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;False&lt;/SPAN&gt;),

File &lt;SPAN class=""&gt;E:\Shared_fold\arcgispro-py3-cloneUN\Lib\site-packages\arcgis\gis\_impl\_con\_connection.py&lt;/SPAN&gt;, in &lt;SPAN class=""&gt;_handle_response&lt;/SPAN&gt;:
Line &lt;SPAN class=""&gt;625&lt;/SPAN&gt;:   &lt;SPAN class=""&gt;self&lt;/SPAN&gt;._handle_json_error(data[&lt;SPAN class=""&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;error&lt;/SPAN&gt;&lt;SPAN class=""&gt;"&lt;/SPAN&gt;], errorcode)

File &lt;SPAN class=""&gt;E:\Shared_fold\arcgispro-py3-cloneUN\Lib\site-packages\arcgis\gis\_impl\_con\_connection.py&lt;/SPAN&gt;, in &lt;SPAN class=""&gt;_handle_json_error&lt;/SPAN&gt;:
Line &lt;SPAN class=""&gt;648&lt;/SPAN&gt;:   &lt;SPAN class=""&gt;raise&lt;/SPAN&gt; &lt;SPAN class=""&gt;Exception&lt;/SPAN&gt;(errormessage)

&lt;SPAN class=""&gt;Exception&lt;/SPAN&gt;: Unable to complete operation.
Features that are utility network subnetwork controllers do not support edits to asset group or asset type attributes.
(Error Code: 400)
&lt;SPAN class=""&gt;---------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;BR /&gt;My code is :&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;from arcgis.features import FeatureLayer&lt;BR /&gt;lyr_url = '&lt;A href="https://abc.test1.com/server/rest/services/BCMCSJ3_5/FeatureServer/0" target="_blank" rel="noopener"&gt;https://abc.test1.com/server/rest/services/BCMCSJ3_5/FeatureServer/0&lt;/A&gt;'&lt;/P&gt;&lt;P&gt;layer = FeatureLayer(lyr_url)&lt;BR /&gt;ports_fset = layer.query()&lt;BR /&gt;ports_features = ports_fset.features&lt;BR /&gt;sfo_feature = [f for f in ports_features if f.attributes['OBJECTID']==3][0]&lt;BR /&gt;sfo_edit = sfo_feature&lt;BR /&gt;sfo_edit.attributes['NOTES2'] = 'RPN'&lt;BR /&gt;update_result = layer.edit_features(updates=[sfo_edit])&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 12:31:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/python-api-to-connect-to-utility-network/m-p/1249004#M8284</guid>
      <dc:creator>Rahul_Pandia</dc:creator>
      <dc:date>2023-01-18T12:31:37Z</dc:date>
    </item>
  </channel>
</rss>

