<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.aras.com/community/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>how getProperty from diffrents level of AML reponse</title><link>https://www.aras.com/community/f/development/37348/how-getproperty-from-diffrents-level-of-aml-reponse</link><description>After applying an AML query, I have a response (structure with root and relation)

How can I get properties from each level of the response?
for example, I would like to get ID at different levels of the responses (Root and relationShip) For first level</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>RE: how getProperty from diffrents level of AML reponse</title><link>https://www.aras.com/community/thread/8304?ContentTypeID=1</link><pubDate>Thu, 12 May 2022 10:07:30 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:f744d6ed-0740-4995-8ba3-381b7836a415</guid><dc:creator>Francois Breton</dc:creator><description>&lt;p&gt;ok, thanks&lt;br /&gt;I will test.&lt;br /&gt;Thanks a lot&lt;/p&gt;
&lt;p&gt;FB&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how getProperty from diffrents level of AML reponse</title><link>https://www.aras.com/community/thread/8298?ContentTypeID=1</link><pubDate>Thu, 12 May 2022 07:18:52 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:7b6294eb-c145-4550-ada9-0a8e736fe23b</guid><dc:creator>AngelaIp</dc:creator><description>&lt;p&gt;HI Brenton,&lt;/p&gt;
&lt;p&gt;I really wished Aras would have the possibility to pass a level index with these kind of queries. See my question here... :-D :&lt;/p&gt;
&lt;p&gt;&lt;a href="/f/development/37188/how-to-get-level-depth-of-items-returned-from-an-getitemrepeatconfig-aml-query"&gt;https://community.aras.com/f/development/37188/how-to-get-level-depth-of-items-returned-from-an-getitemrepeatconfig-aml-query&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Do you know how much levels you have (fixed number of levels)? Then you could use an xpath selector. I don&amp;acute;t have proper sample at hand right now, but try something like this:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;var level2items = item.getItemsByXPath(&amp;quot;Relationships/Item[@type='Part BOM']/related_id/Item[@type='Part']&amp;quot;);&lt;br /&gt;&lt;/span&gt;&lt;span&gt;var level3items = item.getItemsByXPath(&amp;quot;Relationships/Item[@type='Part BOM']/related_id/Item[@type='Part']/Relationships/....;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Search for better samples regarding xpath. Not sure if the above one works.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you just need all items are related at all, something &lt;span style="font-size:12px;"&gt;simpler&lt;/span&gt;&amp;nbsp;would work:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;var&amp;nbsp;allItems= item.getItemsByXPath(&amp;quot;//Item[@type='Part']&amp;quot;);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>