<?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: Using Inspector to modify attribute field in multiple features in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-inspector-to-modify-attribute-field-in/m-p/1261910#M9466</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Problem 1:&lt;/P&gt;&lt;P&gt;I have reported case to esri support about that in November 2022. Case number&amp;nbsp;#03196489&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just ignore IsEmpty value for now, or use your workaround to count for changes.&lt;/P&gt;&lt;P&gt;Problem 2:&lt;/P&gt;&lt;P&gt;Date is not simple string value. Let's try like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;selq.WhereClause = "DATE_LASD = date '2022-04-20 00:00:00'";&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;More info here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/mapping/navigation/sql-reference-for-elements-used-in-query-expressions.htm#GUID-85C03D85-F4A5-48FC-8E8C-3F79919430DB" target="_blank"&gt;SQL reference for query expressions used in ArcGIS—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Feb 2023 06:31:14 GMT</pubDate>
    <dc:creator>GKmieliauskas</dc:creator>
    <dc:date>2023-02-27T06:31:14Z</dc:date>
    <item>
      <title>Using Inspector to modify attribute field in multiple features</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-inspector-to-modify-attribute-field-in/m-p/1261835#M9465</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am struggling to get this snippet to work:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Editing#edit-operation-modify-multiple-features" target="_blank"&gt;https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Editing#edit-operation-modify-multiple-features&lt;/A&gt;&lt;BR /&gt;&lt;STRONG&gt;// at Heading:&lt;/STRONG&gt; Edit Operation Modify multiple features&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Problem #1 is:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;My code below works, loads 421 OIDs but does not execute because&amp;nbsp;modifyFeatures.IsEmpty is TRUE.&lt;/P&gt;&lt;P&gt;The existing date attribute is shown as day-month-year when I look at the attribute table in ArcPro 3.0.2&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Problem #2 is:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I am currently selecting on OID to debug this code, but I need to select features with a specific DATE_LASD.&lt;/P&gt;&lt;P&gt;The following WhereClause fails with&amp;nbsp;'An invalid SQL statement was used.'&lt;/P&gt;&lt;P&gt;(I have tried '-' instead of '/' and also MM-DD-YYYY)&lt;/P&gt;&lt;P&gt;//selq.WhereClause = "DATE_LASD = '20/04/2022'"; // This format is what is shown in Attribute Table&lt;/P&gt;&lt;P&gt;Can anyone spot my deliberate error?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank in advance,&lt;/P&gt;&lt;P&gt;Zoltan&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;        public static void setDateLASD()
        {
            //from:  https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Editing#edit-operation-modify-multiple-features
            // at Heading:  Edit Operation Modify multiple features
            // First deactivate OnRowChanged
            var selq = new QueryFilter();
            //selq.WhereClause = "DATE_LASD = '20/04/2022'";  // This is s what is shown in Attribute Table
            selq.WhereClause = "OBJECTID &amp;gt; 7";
            IEnumerable&amp;lt;FeatureLayer&amp;gt; layers = MapView.Active.Map.GetLayersAsFlattenedList().Where(
                layer =&amp;gt; layer is FeatureLayer).Select(x =&amp;gt; (FeatureLayer)x);
            foreach (var dset in layers)
            {
                if ((dset.Name.EndsWith("_Point")) ||
                    (dset.Name.EndsWith("_Line")) ||
                    (dset.Name.EndsWith("_Polygon")))
                {
                    QueuedTask.Run(() =&amp;gt;
                    {
                        var oidSet = new List&amp;lt;long&amp;gt;();
                        using (var selset = dset.Search(selq))
                        {
                            while (selset.MoveNext())
                            {
                                using (var record = selset.Current)
                                {
                                    oidSet.Add(record.GetObjectID());
                                }
                            }
                        }
                        //create and execute the edit operation
                        var modifyFeatures = new EditOperation();
                        modifyFeatures.Name = "Modify LASD";
                        modifyFeatures.ShowProgressor = true;
                        var multipleFeaturesInsp = new Inspector();
                        multipleFeaturesInsp.AllowEditing = true;
                        multipleFeaturesInsp.Load(dset, oidSet);
                        multipleFeaturesInsp["DATE_LASD"] = "21/08/2022";
                        modifyFeatures.Modify(multipleFeaturesInsp);
                        if (!modifyFeatures.IsEmpty)
                        {
                            var result = modifyFeatures.ExecuteAsync(); //Execute and ExecuteAsync will return true if the operation was successful and false if not
                        }
                    });
                }
            }
                // Now reactivate OnRowChanged
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Feb 2023 14:19:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-inspector-to-modify-attribute-field-in/m-p/1261835#M9465</guid>
      <dc:creator>Zoltan_Szecsei</dc:creator>
      <dc:date>2023-02-26T14:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using Inspector to modify attribute field in multiple features</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-inspector-to-modify-attribute-field-in/m-p/1261910#M9466</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Problem 1:&lt;/P&gt;&lt;P&gt;I have reported case to esri support about that in November 2022. Case number&amp;nbsp;#03196489&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just ignore IsEmpty value for now, or use your workaround to count for changes.&lt;/P&gt;&lt;P&gt;Problem 2:&lt;/P&gt;&lt;P&gt;Date is not simple string value. Let's try like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;selq.WhereClause = "DATE_LASD = date '2022-04-20 00:00:00'";&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;More info here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/mapping/navigation/sql-reference-for-elements-used-in-query-expressions.htm#GUID-85C03D85-F4A5-48FC-8E8C-3F79919430DB" target="_blank"&gt;SQL reference for query expressions used in ArcGIS—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 06:31:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-inspector-to-modify-attribute-field-in/m-p/1261910#M9466</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2023-02-27T06:31:14Z</dc:date>
    </item>
    <item>
      <title>Re: Using Inspector to modify attribute field in multiple features</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-inspector-to-modify-attribute-field-in/m-p/1261927#M9467</link>
      <description>&lt;P&gt;Both worked.&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Zoltan&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 08:57:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/using-inspector-to-modify-attribute-field-in/m-p/1261927#M9467</guid>
      <dc:creator>Zoltan_Szecsei</dc:creator>
      <dc:date>2023-02-27T08:57:20Z</dc:date>
    </item>
  </channel>
</rss>

