<?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 Attribute Rule That Brings Attachments From One Table to Another in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-that-brings-attachments-from-one/m-p/1166831#M395</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am doing something a bit confusing to explain. I am creating my own Historical Table for when an inspection is done. I am doing this with the Code below. This is working exactly as planned when someone fills out the inspection in Table1 it populates my historical table (Table2). What the problem I am running into is when they fill out the inspection they are taking 12 - 16 photos each time they fill out an inspection. There is an _ATTACH table associated with BOTH tables. I want to be able to populate the _ATTACH table for Table 2 after the new record is pulled from Table1, but the GloablID (In Table2 and Table2_ATTACH) field is regenerated and then I am getting stuck on what to do next.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I need - An attribute Rule that will, when a new Photo is taken in Table1, Will move it to Table2 and Change the REL_GloablID field to the new GloablID that was Created in Table2. (I have a Link between Table1 and Table2 in a new GUID field called DuneGloablID in Table2) I feel like there should be a way use this field to do what I am looking for.&lt;/P&gt;&lt;PRE&gt;return {&lt;BR /&gt;//we want to just return the value of field `Field` no change require&lt;BR /&gt;"result": $feature.InspectionDate,&lt;BR /&gt;//this keyword indicates an edit that need to happen, its an array since we can make many edits&lt;BR /&gt;"edit": [ &lt;BR /&gt;{ &lt;BR /&gt;//the other class we want to edit&lt;BR /&gt;"className" : "DATABASE.DBO.TABLE2", &lt;BR /&gt;//the type of edit, in this case we want to add so we say `adds`, its an array since we can make many inserts&lt;BR /&gt;"adds" : [&lt;BR /&gt;&lt;BR /&gt;{&lt;BR /&gt;//the attribute of the feature we want to add&lt;BR /&gt;"attributes": &lt;BR /&gt;{&lt;BR /&gt;"DuneGlobalID": $feature.globalid,&lt;BR /&gt;"InspectionDate": $feature.InspectionDate,&lt;BR /&gt;"Profile_Number": $feature.Profile_Number,&lt;BR /&gt;"Jurisdiction": $feature.Jurisdiction,&lt;BR /&gt;"Contract": $feature.Contract,&lt;BR /&gt;"Inspection_Type": $feature.Inspection_Type,&lt;BR /&gt;"InspectionDateOther": $feature.InspectionDateOther,&lt;BR /&gt;"Dune_Berm_Condition": $feature.Dune_Berm_Condition,&lt;BR /&gt;"Inspected_By1": $feature.Inspected_By1,&lt;BR /&gt;"Inspected_By2": $feature.Inspected_By2,&lt;BR /&gt;"Unusual_Settlement": $feature.Unusual_Settlement,&lt;BR /&gt;"Unusual_Settlement_Comment": $feature.Unusual_Settlement_Comment,&lt;BR /&gt;"Sloughing": $feature.Sloughing,&lt;BR /&gt;"Sloughing_Comment": $feature.Sloughing_Comment,&lt;BR /&gt;"Erosion_Cross_Section": $feature.Erosion_Cross_Section,&lt;BR /&gt;"Erosion_Cross_Section_Comment": $feature.Erosion_Cross_Section_Comment,&lt;BR /&gt;"Scarping": $feature.Scarping,&lt;BR /&gt;"Scarping_Comment": $feature.Scarping_Comment,&lt;BR /&gt;"Unauthorized_Excav_Vand": $feature.Unauthorized_Excav_Vand,&lt;BR /&gt;"Unauthorized_Excav_Vand_Comme": $feature.Unauthorized_Excav_Vand_Comme,&lt;BR /&gt;"Overtopping_During_High_Wat": $feature.Overtopping_During_High_Wat,&lt;BR /&gt;"Overtopping_During_High_Wat_C": $feature.Overtopping_During_High_Wat_C,&lt;BR /&gt;"Accumulation_of_D": $feature.Accumulation_of_D,&lt;BR /&gt;"Accumulation_of_D_Comment": $feature.Accumulation_of_D_Comment,&lt;BR /&gt;"Excessive_Growth_G_or_W": $feature.Excessive_Growth_G_or_W,&lt;BR /&gt;"Excessive_Growth_G_or_W_Comme": $feature.Excessive_Growth_G_or_W_Comme,&lt;BR /&gt;"Localized_Wind_Erosion": $feature.Localized_Wind_Erosion,&lt;BR /&gt;"Localized_Wind_Erosion_Commen": $feature.Localized_Wind_Erosion_Commen,&lt;BR /&gt;"Encroachment_on_Dune": $feature.Encroachment_on_Dune,&lt;BR /&gt;"Encroachment_on_Dune_Comment": $feature.Encroachment_on_Dune_Comment,&lt;BR /&gt;"Sand_Fence_Condition": $feature.Sand_Fence_Condition,&lt;BR /&gt;"Sand_Fence_Condition_Comment": $feature.Sand_Fence_Condition_Comment,&lt;BR /&gt;"Sand_Accumulation": $feature.Sand_Accumulation,&lt;BR /&gt;"Sand_Accumulation_Comment": $feature.Sand_Accumulation_Comment,&lt;BR /&gt;"Exccessive_Accumulation": $feature.Exccessive_Accumulation,&lt;BR /&gt;"Exccessive_Accumulation_Comme": $feature.Exccessive_Accumulation_Comme,&lt;BR /&gt;"Required_Maintance": $feature.Required_Maintance,&lt;BR /&gt;"General_Condition": $feature.General_Condition,&lt;BR /&gt;"Remarks": $feature.Remarks&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;]&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;]&lt;BR /&gt;&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Thank You in advance. If you have any&amp;nbsp; questions feel free to reach out.&lt;/P&gt;</description>
    <pubDate>Thu, 21 Apr 2022 20:24:48 GMT</pubDate>
    <dc:creator>GdB_Admin</dc:creator>
    <dc:date>2022-04-21T20:24:48Z</dc:date>
    <item>
      <title>Attribute Rule That Brings Attachments From One Table to Another</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-that-brings-attachments-from-one/m-p/1166831#M395</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am doing something a bit confusing to explain. I am creating my own Historical Table for when an inspection is done. I am doing this with the Code below. This is working exactly as planned when someone fills out the inspection in Table1 it populates my historical table (Table2). What the problem I am running into is when they fill out the inspection they are taking 12 - 16 photos each time they fill out an inspection. There is an _ATTACH table associated with BOTH tables. I want to be able to populate the _ATTACH table for Table 2 after the new record is pulled from Table1, but the GloablID (In Table2 and Table2_ATTACH) field is regenerated and then I am getting stuck on what to do next.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I need - An attribute Rule that will, when a new Photo is taken in Table1, Will move it to Table2 and Change the REL_GloablID field to the new GloablID that was Created in Table2. (I have a Link between Table1 and Table2 in a new GUID field called DuneGloablID in Table2) I feel like there should be a way use this field to do what I am looking for.&lt;/P&gt;&lt;PRE&gt;return {&lt;BR /&gt;//we want to just return the value of field `Field` no change require&lt;BR /&gt;"result": $feature.InspectionDate,&lt;BR /&gt;//this keyword indicates an edit that need to happen, its an array since we can make many edits&lt;BR /&gt;"edit": [ &lt;BR /&gt;{ &lt;BR /&gt;//the other class we want to edit&lt;BR /&gt;"className" : "DATABASE.DBO.TABLE2", &lt;BR /&gt;//the type of edit, in this case we want to add so we say `adds`, its an array since we can make many inserts&lt;BR /&gt;"adds" : [&lt;BR /&gt;&lt;BR /&gt;{&lt;BR /&gt;//the attribute of the feature we want to add&lt;BR /&gt;"attributes": &lt;BR /&gt;{&lt;BR /&gt;"DuneGlobalID": $feature.globalid,&lt;BR /&gt;"InspectionDate": $feature.InspectionDate,&lt;BR /&gt;"Profile_Number": $feature.Profile_Number,&lt;BR /&gt;"Jurisdiction": $feature.Jurisdiction,&lt;BR /&gt;"Contract": $feature.Contract,&lt;BR /&gt;"Inspection_Type": $feature.Inspection_Type,&lt;BR /&gt;"InspectionDateOther": $feature.InspectionDateOther,&lt;BR /&gt;"Dune_Berm_Condition": $feature.Dune_Berm_Condition,&lt;BR /&gt;"Inspected_By1": $feature.Inspected_By1,&lt;BR /&gt;"Inspected_By2": $feature.Inspected_By2,&lt;BR /&gt;"Unusual_Settlement": $feature.Unusual_Settlement,&lt;BR /&gt;"Unusual_Settlement_Comment": $feature.Unusual_Settlement_Comment,&lt;BR /&gt;"Sloughing": $feature.Sloughing,&lt;BR /&gt;"Sloughing_Comment": $feature.Sloughing_Comment,&lt;BR /&gt;"Erosion_Cross_Section": $feature.Erosion_Cross_Section,&lt;BR /&gt;"Erosion_Cross_Section_Comment": $feature.Erosion_Cross_Section_Comment,&lt;BR /&gt;"Scarping": $feature.Scarping,&lt;BR /&gt;"Scarping_Comment": $feature.Scarping_Comment,&lt;BR /&gt;"Unauthorized_Excav_Vand": $feature.Unauthorized_Excav_Vand,&lt;BR /&gt;"Unauthorized_Excav_Vand_Comme": $feature.Unauthorized_Excav_Vand_Comme,&lt;BR /&gt;"Overtopping_During_High_Wat": $feature.Overtopping_During_High_Wat,&lt;BR /&gt;"Overtopping_During_High_Wat_C": $feature.Overtopping_During_High_Wat_C,&lt;BR /&gt;"Accumulation_of_D": $feature.Accumulation_of_D,&lt;BR /&gt;"Accumulation_of_D_Comment": $feature.Accumulation_of_D_Comment,&lt;BR /&gt;"Excessive_Growth_G_or_W": $feature.Excessive_Growth_G_or_W,&lt;BR /&gt;"Excessive_Growth_G_or_W_Comme": $feature.Excessive_Growth_G_or_W_Comme,&lt;BR /&gt;"Localized_Wind_Erosion": $feature.Localized_Wind_Erosion,&lt;BR /&gt;"Localized_Wind_Erosion_Commen": $feature.Localized_Wind_Erosion_Commen,&lt;BR /&gt;"Encroachment_on_Dune": $feature.Encroachment_on_Dune,&lt;BR /&gt;"Encroachment_on_Dune_Comment": $feature.Encroachment_on_Dune_Comment,&lt;BR /&gt;"Sand_Fence_Condition": $feature.Sand_Fence_Condition,&lt;BR /&gt;"Sand_Fence_Condition_Comment": $feature.Sand_Fence_Condition_Comment,&lt;BR /&gt;"Sand_Accumulation": $feature.Sand_Accumulation,&lt;BR /&gt;"Sand_Accumulation_Comment": $feature.Sand_Accumulation_Comment,&lt;BR /&gt;"Exccessive_Accumulation": $feature.Exccessive_Accumulation,&lt;BR /&gt;"Exccessive_Accumulation_Comme": $feature.Exccessive_Accumulation_Comme,&lt;BR /&gt;"Required_Maintance": $feature.Required_Maintance,&lt;BR /&gt;"General_Condition": $feature.General_Condition,&lt;BR /&gt;"Remarks": $feature.Remarks&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;]&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;]&lt;BR /&gt;&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Thank You in advance. If you have any&amp;nbsp; questions feel free to reach out.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 20:24:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rule-that-brings-attachments-from-one/m-p/1166831#M395</guid>
      <dc:creator>GdB_Admin</dc:creator>
      <dc:date>2022-04-21T20:24:48Z</dc:date>
    </item>
  </channel>
</rss>

