<?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: One feature not showing edits made when using edit_feature function in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/one-feature-not-showing-edits-made-when-using-edit/m-p/1247990#M8267</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/611460"&gt;@ColeHowell&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It could be that the&amp;nbsp;elif edit.attributes['constrno2'] == 'P10' never gets executed.&lt;/P&gt;&lt;P&gt;Try&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def update_zone_meters(dictionary):
    gis = GIS("url", "username", "password")
    portal_item = gis.content.get('item id')
    meter_layer = portal_item.layers[0]
    meter_fset = meter_layer.query()
    meter_features = meter_fset.features

    for meter in meter_features:
        edit = meter
        #print(edit.attributes['constrno2'])
        if (edit.attributes['constrno2'] + 'F') in dictionary:
            #print(dictionary[edit.attributes['constrno2']+'F'])
            edit.attributes['forward_flow'] = dictionary[edit.attributes['constrno2']+'F']
            #print(edit.attributes['forward_flow'])
        else:
            continue

        ## EDITED HERE to an if/else
        if edit.attributes['constrno2'] == 'P10':
            edit.attributes['forward_flow'] = dictionary[edit.attributes['constrno2']]
            edit.attributes['reverse_flow'] = 0.0
        else:
            continue

        if (edit.attributes['constrno2'] + 'R') in dictionary:
            edit.attributes['reverse_flow'] = dictionary[edit.attributes['constrno2'] + 'R']
        else:
            continue

        meter_layer.edit_features(updates=[edit])&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 13 Jan 2023 11:25:25 GMT</pubDate>
    <dc:creator>Clubdebambos</dc:creator>
    <dc:date>2023-01-13T11:25:25Z</dc:date>
    <item>
      <title>One feature not showing edits made when using edit_feature function</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/one-feature-not-showing-edits-made-when-using-edit/m-p/1244539#M8232</link>
      <description>&lt;P&gt;Title says it all. I'm working for a water company and am developing a system to take flow data from our SCADA system and import the data into GIS for leak detection purposes. Specifically what I'm working on now takes the forward and reverse flow and puts those numbers into those fields on my zone meter hosted feature layer. The problem I'm having is that the 'P10' meter's fields are not being updated when I run the script while the rest of the meters I'm working with are working just fine. I just need a little help troubleshooting since I'm new to using the API. I'm attaching the function I wrote to do this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def update_zone_meters(dictionary):
    gis = GIS("url", "username", "password")
    portal_item = gis.content.get('item id')
    meter_layer = portal_item.layers[0]
    meter_fset = meter_layer.query()
    meter_features = meter_fset.features

    for meter in meter_features:
        edit = meter
        #print(edit.attributes['constrno2'])
        if (edit.attributes['constrno2'] + 'F') in dictionary:
            #print(dictionary[edit.attributes['constrno2']+'F'])
            edit.attributes['forward_flow'] = dictionary[edit.attributes['constrno2']+'F']
            #print(edit.attributes['forward_flow'])
        elif edit.attributes['constrno2'] == 'P10':
            edit.attributes['forward_flow'] = dictionary[edit.attributes['constrno2']]
            edit.attributes['reverse_flow'] = 0.0
        else:
            continue

        if (edit.attributes['constrno2'] + 'R') in dictionary:
            edit.attributes['reverse_flow'] = dictionary[edit.attributes['constrno2'] + 'R']
        else:
            continue

        meter_layer.edit_features(updates=[edit])&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 30 Dec 2022 13:45:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/one-feature-not-showing-edits-made-when-using-edit/m-p/1244539#M8232</guid>
      <dc:creator>ColeHowell</dc:creator>
      <dc:date>2022-12-30T13:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: One feature not showing edits made when using edit_feature function</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/one-feature-not-showing-edits-made-when-using-edit/m-p/1247990#M8267</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/611460"&gt;@ColeHowell&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It could be that the&amp;nbsp;elif edit.attributes['constrno2'] == 'P10' never gets executed.&lt;/P&gt;&lt;P&gt;Try&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def update_zone_meters(dictionary):
    gis = GIS("url", "username", "password")
    portal_item = gis.content.get('item id')
    meter_layer = portal_item.layers[0]
    meter_fset = meter_layer.query()
    meter_features = meter_fset.features

    for meter in meter_features:
        edit = meter
        #print(edit.attributes['constrno2'])
        if (edit.attributes['constrno2'] + 'F') in dictionary:
            #print(dictionary[edit.attributes['constrno2']+'F'])
            edit.attributes['forward_flow'] = dictionary[edit.attributes['constrno2']+'F']
            #print(edit.attributes['forward_flow'])
        else:
            continue

        ## EDITED HERE to an if/else
        if edit.attributes['constrno2'] == 'P10':
            edit.attributes['forward_flow'] = dictionary[edit.attributes['constrno2']]
            edit.attributes['reverse_flow'] = 0.0
        else:
            continue

        if (edit.attributes['constrno2'] + 'R') in dictionary:
            edit.attributes['reverse_flow'] = dictionary[edit.attributes['constrno2'] + 'R']
        else:
            continue

        meter_layer.edit_features(updates=[edit])&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 13 Jan 2023 11:25:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/one-feature-not-showing-edits-made-when-using-edit/m-p/1247990#M8267</guid>
      <dc:creator>Clubdebambos</dc:creator>
      <dc:date>2023-01-13T11:25:25Z</dc:date>
    </item>
  </channel>
</rss>

