<?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: FeatureSetByAssociation function takes only $feature as input in ArcGIS Utility Network Questions</title>
    <link>https://community.esri.com/t5/arcgis-utility-network-questions/featuresetbyassociation-function-takes-only/m-p/1196318#M1870</link>
    <description>&lt;P data-unlink="true"&gt;The error is likely because of a duplicate association in your UN.&amp;nbsp; This sound very similar to&amp;nbsp;&lt;A href="https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDE0Nzg2MQ==" target="_self"&gt;Bug BUG-000147861.&lt;/A&gt; Can you find that feature with the global id?&amp;nbsp; You may have to look at the association table.&amp;nbsp; The &lt;A href="https://github.com/Esri/Utility-Data-Management-Support-Tools" target="_self"&gt;UDMS&lt;/A&gt; toolset has a GP tool that will generate a view of your association table.&amp;nbsp; Apply a def filter on this using the reported global IDs and see if there is indeed a duplicate association.&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 27 Jul 2022 13:47:30 GMT</pubDate>
    <dc:creator>MikeMillerGIS</dc:creator>
    <dc:date>2022-07-27T13:47:30Z</dc:date>
    <item>
      <title>FeatureSetByAssociation function takes only $feature as input</title>
      <link>https://community.esri.com/t5/arcgis-utility-network-questions/featuresetbyassociation-function-takes-only/m-p/1195895#M1866</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;as described in this &lt;A href="https://www.esri.com/arcgis-blog/products/utility-network/data-management/featuresetbyassocaitions-new-utility-network-arcade-api-to-work-with-associations-2-5-10-8/" target="_self"&gt;blog&lt;/A&gt;, we can use the&amp;nbsp;&lt;A href="https://developers.arcgis.com/arcade/function-reference/data_functions/#featuresetbyassociation" target="_self"&gt;FeatureSetByAssociation&lt;/A&gt; function, for example, to get all the containments of the station boundary. However, there is a message that the syntax is invalid if&amp;nbsp; there is a variable as input (not $feature). Does anyone has an idea how to fix it?&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var boundaries = FeatureSetByName($datastore, 'StructureBoundary', ['globalid'], true) //get all structure boundaries with geometry&lt;BR /&gt;var intersect = Intersects(boundaries, $feature) //get all boundaries that intersect with created feature&lt;BR /&gt;var stationBoundary = First(intersect) //select first station boundary (the only one) in order to convert from featureSet to feature&lt;BR /&gt;var content = FeatureSetByAssociation(stationBoundary, 'content') //get all containments of stationBoundary -&amp;gt; ERROR Invalid expression. Feature expected.&lt;BR /&gt;var assembly = Filter(content, "className = 'ElectricAssembly'") //filter containments for electricAssemblies&lt;/P&gt;&lt;P&gt;return{ //returns nothing - edits to containment of class "ElectricAssembly" with globalid of assembly&lt;BR /&gt;"edit":[{&lt;BR /&gt;"className": "^UN_Association",&lt;BR /&gt;"adds": [{&lt;BR /&gt;"fromClass": "ElectricAssembly",&lt;BR /&gt;"fromGlobalId": "assembly.globalid",&lt;BR /&gt;"toClass": "ElectricJunction",&lt;BR /&gt;"toGlobalId": "$feature.globalId",&lt;BR /&gt;"associationType": "container"&lt;BR /&gt;}]&lt;BR /&gt;}]&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2022 13:59:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-utility-network-questions/featuresetbyassociation-function-takes-only/m-p/1195895#M1866</guid>
      <dc:creator>OlgaKoblet</dc:creator>
      <dc:date>2022-07-26T13:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureSetByAssociation function takes only $feature as input</title>
      <link>https://community.esri.com/t5/arcgis-utility-network-questions/featuresetbyassociation-function-takes-only/m-p/1195916#M1867</link>
      <description>&lt;P&gt;I believe the code is correct, but the validation logic is not returning a feature.&amp;nbsp; So you just need to add a check for if&amp;nbsp;&lt;SPAN&gt;stationBoundary&amp;nbsp;is null and that way the validator exits early.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Add this under var&amp;nbsp;stationBoundary&amp;nbsp; = First(.....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if (IsEmpty(stationBoundary)){&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; return;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2022 14:36:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-utility-network-questions/featuresetbyassociation-function-takes-only/m-p/1195916#M1867</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2022-07-26T14:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureSetByAssociation function takes only $feature as input</title>
      <link>https://community.esri.com/t5/arcgis-utility-network-questions/featuresetbyassociation-function-takes-only/m-p/1196303#M1869</link>
      <description>&lt;P&gt;I work on the same problem as &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/468635"&gt;@OlgaKoblet&lt;/a&gt; and yes: the code finally validates. However, if we try to execute the code and create a new feature, it says that the Association already exists which - as far as I am concerned - shouldn't be possible, as we make a new association with a feature that isn't even there at the moment. Any tips on how we could solve this?&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;var boundaries = FeatureSetByName($datastore, "StructureBoundary", ["globalid"], true);&amp;nbsp;&lt;BR /&gt;if(isempty(boundaries)){&lt;BR /&gt;return {"errorMessage": "no boundaries found."};&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;var intersectBoundaries = Intersects(boundaries, $feature);&amp;nbsp;&lt;BR /&gt;if(isempty(intersectBoundaries)){&lt;BR /&gt;return {"errorMessage": "no intersected boundaries found."};&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;var structureBoundary = First(intersectBoundaries);&amp;nbsp;&lt;BR /&gt;if(isempty(structureBoundary)){&lt;BR /&gt;return {"errorMessage": "no structure boundary found."};&lt;BR /&gt;}&amp;nbsp;&lt;/P&gt;&lt;P&gt;var contentOfBoundary = FeatureSetByAssociation(structureBoundary, "content");&amp;nbsp;&lt;BR /&gt;if(isempty(contentOfBoundary)){&lt;BR /&gt;return {"errorMessage": "no content found."};&lt;BR /&gt;}&amp;nbsp;&lt;/P&gt;&lt;P&gt;var assembly = First(contentOfBoundary) &amp;nbsp;&lt;BR /&gt;if(isempty(assembly)){&lt;BR /&gt;return {"errorMessage": "no assembly found."};&lt;BR /&gt;}&amp;nbsp;&lt;/P&gt;&lt;P&gt;return{&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "edit":[{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "className": "^UN_Association",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "adds": [{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "fromClass": "ElectricAssembly",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "fromGlobalId": "assembly.globalid",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "toClass": "ElectricJunction",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "toGlobalId": "$feature.globalid",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "associationType": "containment"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }]&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Throws this Error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="StefanAngerer_2-1658927286799.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/46900i82CB23A814A066AE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="StefanAngerer_2-1658927286799.png" alt="StefanAngerer_2-1658927286799.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks and kind regards!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2022 13:08:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-utility-network-questions/featuresetbyassociation-function-takes-only/m-p/1196303#M1869</guid>
      <dc:creator>StefanAngerer</dc:creator>
      <dc:date>2022-07-27T13:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureSetByAssociation function takes only $feature as input</title>
      <link>https://community.esri.com/t5/arcgis-utility-network-questions/featuresetbyassociation-function-takes-only/m-p/1196318#M1870</link>
      <description>&lt;P data-unlink="true"&gt;The error is likely because of a duplicate association in your UN.&amp;nbsp; This sound very similar to&amp;nbsp;&lt;A href="https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDE0Nzg2MQ==" target="_self"&gt;Bug BUG-000147861.&lt;/A&gt; Can you find that feature with the global id?&amp;nbsp; You may have to look at the association table.&amp;nbsp; The &lt;A href="https://github.com/Esri/Utility-Data-Management-Support-Tools" target="_self"&gt;UDMS&lt;/A&gt; toolset has a GP tool that will generate a view of your association table.&amp;nbsp; Apply a def filter on this using the reported global IDs and see if there is indeed a duplicate association.&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2022 13:47:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-utility-network-questions/featuresetbyassociation-function-takes-only/m-p/1196318#M1870</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2022-07-27T13:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureSetByAssociation function takes only $feature as input</title>
      <link>https://community.esri.com/t5/arcgis-utility-network-questions/featuresetbyassociation-function-takes-only/m-p/1198421#M1883</link>
      <description>&lt;P&gt;How do I generate the view of the association tables? Which tool in GP tool I have to use? And how?&lt;BR /&gt;Thanks and kind regards!&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 09:52:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-utility-network-questions/featuresetbyassociation-function-takes-only/m-p/1198421#M1883</guid>
      <dc:creator>PeterStampfl</dc:creator>
      <dc:date>2022-08-02T09:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureSetByAssociation function takes only $feature as input</title>
      <link>https://community.esri.com/t5/arcgis-utility-network-questions/featuresetbyassociation-function-takes-only/m-p/1198427#M1884</link>
      <description>&lt;P&gt;Still working on the online help, but this is the tool -&amp;nbsp;&lt;A href="https://esri.github.io/Utility-Data-Management-Support-Tools/docs/2.9/AddUNSystemTables.html" target="_blank"&gt;https://esri.github.io/Utility-Data-Management-Support-Tools/docs/2.9/AddUNSystemTables.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 10:44:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-utility-network-questions/featuresetbyassociation-function-takes-only/m-p/1198427#M1884</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2022-08-02T10:44:04Z</dc:date>
    </item>
  </channel>
</rss>

