<?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 string expression parameter in EditOperation.TransferAttributes overload? in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/string-expression-parameter-in-editoperation/m-p/1556579#M12268</link>
    <description>&lt;P&gt;Simple question, I hope:&amp;nbsp;&lt;/P&gt;&lt;P&gt;What kind of "override" string expression is expected in this&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic26136.html" target="_blank" rel="noopener"&gt;EditOperation.TransferAttributes&lt;/A&gt;&amp;nbsp;overload method?&amp;nbsp; Does anyone have an example or know of relevant documentation?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Nov 2024 21:50:46 GMT</pubDate>
    <dc:creator>KerryAlley</dc:creator>
    <dc:date>2024-11-07T21:50:46Z</dc:date>
    <item>
      <title>string expression parameter in EditOperation.TransferAttributes overload?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/string-expression-parameter-in-editoperation/m-p/1556579#M12268</link>
      <description>&lt;P&gt;Simple question, I hope:&amp;nbsp;&lt;/P&gt;&lt;P&gt;What kind of "override" string expression is expected in this&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic26136.html" target="_blank" rel="noopener"&gt;EditOperation.TransferAttributes&lt;/A&gt;&amp;nbsp;overload method?&amp;nbsp; Does anyone have an example or know of relevant documentation?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 21:50:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/string-expression-parameter-in-editoperation/m-p/1556579#M12268</guid>
      <dc:creator>KerryAlley</dc:creator>
      <dc:date>2024-11-07T21:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: string expression parameter in EditOperation.TransferAttributes overload?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/string-expression-parameter-in-editoperation/m-p/1557170#M12275</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a sample of the expression that can be used to map field values between two features or rows with the EditOperation.TransferAttributes function.&lt;/P&gt;
&lt;P&gt;return {&lt;BR /&gt;"ADDRESS" : $sourceFeature['ADDRESS'],&lt;BR /&gt;"IMAGE" : $sourceFeature['IMAGE'],&lt;BR /&gt;"PRECINCT" : $sourceFeature['PRECINCT'],&lt;BR /&gt;"WEBSITE" : $sourceFeature['WEBSITE'],&lt;BR /&gt;"ZIP" : $sourceFeature['ZIP']&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an example of a simple button that will transfer attributes from a source feature (oid 1) in the Police Stations layer to a destination feature&amp;nbsp; (oid 2) in the same layer&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;protected override void OnClick()
{
  var layer = MapView.Active.Map.GetLayersAsFlattenedList().FirstOrDefault(l =&amp;gt; l.Name == "Police Stations");
  if (layer == null)
    return;

  string expression = "return {\r\n  " +
      "\"ADDRESS\" : $sourceFeature['ADDRESS'],\r\n  " +
      "\"IMAGE\" : $sourceFeature['IMAGE'],\r\n  + " +
      "\"PRECINCT\" : $sourceFeature['PRECINCT'],\r\n  " +
      "\"WEBSITE\" : $sourceFeature['WEBSITE'],\r\n  " +
      "\"ZIP\" : $sourceFeature['ZIP']\r\n " +
      "}";

  QueuedTask.Run(() =&amp;gt;
  {
    var op = new EditOperation();
    op.Name = "Transfer atts";

    op.TransferAttributes(layer, 1, layer, 2, expression);

    var success = op.Execute();
  });
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll make sure the documentation for the function is updated.&amp;nbsp; &amp;nbsp;Let me know if you have any additional questions.&lt;/P&gt;
&lt;P&gt;Narelle&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2024 01:51:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/string-expression-parameter-in-editoperation/m-p/1557170#M12275</guid>
      <dc:creator>NarelleChedzey</dc:creator>
      <dc:date>2024-11-11T01:51:13Z</dc:date>
    </item>
  </channel>
</rss>

