<?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: Query array in optionlist logic for networks in HPE Morpheus Enterprise Software</title>
    <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/query-array-in-optionlist-logic-for-networks/m-p/7250189#M3363</link>
    <description>&lt;P&gt;I’m trying to refine the logic so if it finds “provisioning” in first or second element of the array. But cannot get the logic to work.&lt;/P&gt;
&lt;P&gt;for(var x=0;x &amp;lt; data.networks.length; x++) {&lt;BR /&gt;
if (data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.dhcpServer == false &amp;amp;&amp;amp; data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.visibility == “public” &amp;amp;&amp;amp; data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.labels.length &amp;gt; 0) {&lt;BR /&gt;
if (data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.labels[0].includes(‘provisioning’) || data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.labels[1].includes(‘provisioning’)) {&lt;BR /&gt;
results.push({name: data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.name, value: data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.id});&lt;BR /&gt;
}&lt;BR /&gt;
}}&lt;/P&gt;
&lt;P&gt;What am I missing?&lt;/P&gt;
&lt;P&gt;Cheers&lt;BR /&gt;
Jon&lt;/P&gt;</description>
    <pubDate>Fri, 26 Apr 2024 12:17:22 GMT</pubDate>
    <dc:creator />
    <dc:date>2024-04-26T12:17:22Z</dc:date>
    <item>
      <title>Query array in optionlist logic for networks</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/query-array-in-optionlist-logic-for-networks/m-p/7250187#M3361</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I’m trying to refine our  optionlist logic for selecting networks:&lt;/P&gt;
&lt;P&gt;Currently I have:&lt;/P&gt;
&lt;P&gt;for(var x=0;x &amp;lt; data.networks.length; x++) {&lt;BR /&gt;
if (data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.dhcpServer == true &amp;amp;&amp;amp; data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.visibility == “public” &amp;amp;&amp;amp; data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.labels.length &amp;gt; 0) {&lt;BR /&gt;
results.push({name: data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.name, value: data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.id});&lt;BR /&gt;
}&lt;BR /&gt;
}&lt;/P&gt;
&lt;P&gt;Which works, however I would like to refine.&lt;/P&gt;
&lt;P&gt;Basically I want to match the contents of data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.labels so if a label is set as “provisioning” it’s selected.&lt;/P&gt;
&lt;P&gt;I have tried data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.labels  == “provisioning” but  it does not  pick up. I have tried data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.labels.includes (‘provisioning’) but the query errors as it does not like includes,&lt;/P&gt;
&lt;P&gt;When I query the API, I say it’s: -provisioning.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;DIV class="lightbox-wrapper"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/150140iF1F26AF12C41519E/image-size/large?v=v2&amp;amp;px=2000" role="button" title="6520fd0b4311c71a11ab3fdb512f076b321f1ea7.png" alt="6520fd0b4311c71a11ab3fdb512f076b321f1ea7.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Any ideas on the correct syntax to  use?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2024 13:47:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/query-array-in-optionlist-logic-for-networks/m-p/7250187#M3361</guid>
      <dc:creator />
      <dc:date>2024-03-26T13:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Query array in optionlist logic for networks</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/query-array-in-optionlist-logic-for-networks/m-p/7250188#M3362</link>
      <description>&lt;P&gt;Thanks that is now working.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2024 15:49:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/query-array-in-optionlist-logic-for-networks/m-p/7250188#M3362</guid>
      <dc:creator />
      <dc:date>2024-03-26T15:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: Query array in optionlist logic for networks</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/query-array-in-optionlist-logic-for-networks/m-p/7250189#M3363</link>
      <description>&lt;P&gt;I’m trying to refine the logic so if it finds “provisioning” in first or second element of the array. But cannot get the logic to work.&lt;/P&gt;
&lt;P&gt;for(var x=0;x &amp;lt; data.networks.length; x++) {&lt;BR /&gt;
if (data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.dhcpServer == false &amp;amp;&amp;amp; data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.visibility == “public” &amp;amp;&amp;amp; data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.labels.length &amp;gt; 0) {&lt;BR /&gt;
if (data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.labels[0].includes(‘provisioning’) || data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.labels[1].includes(‘provisioning’)) {&lt;BR /&gt;
results.push({name: data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.name, value: data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.id});&lt;BR /&gt;
}&lt;BR /&gt;
}}&lt;/P&gt;
&lt;P&gt;What am I missing?&lt;/P&gt;
&lt;P&gt;Cheers&lt;BR /&gt;
Jon&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2024 12:17:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/query-array-in-optionlist-logic-for-networks/m-p/7250189#M3363</guid>
      <dc:creator />
      <dc:date>2024-04-26T12:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Query array in optionlist logic for networks</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/query-array-in-optionlist-logic-for-networks/m-p/7250190#M3364</link>
      <description>&lt;P&gt;Found the fix:&lt;/P&gt;
&lt;P&gt;for(var x=0;x &amp;lt; data.networks.length; x++) {&lt;BR /&gt;
if (data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.dhcpServer == false &amp;amp;&amp;amp; data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.visibility == “public” &amp;amp;&amp;amp; data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.labels.length &amp;gt; 0) {&lt;BR /&gt;
if (data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.labels[0].includes(‘provisioning’)){&lt;BR /&gt;
results.push({name: data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.name, value: data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.id});&lt;BR /&gt;
}&lt;BR /&gt;
}&lt;BR /&gt;
if (data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.dhcpServer == false &amp;amp;&amp;amp; data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.visibility == “public” &amp;amp;&amp;amp; data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.labels.length &amp;gt; 1) {&lt;BR /&gt;
if (data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.labels[1].includes(‘provisioning’)){&lt;BR /&gt;
results.push({name: data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.name, value: data.networks&lt;SPAN class="chcklst-box checked fa fa-check-square-o fa-fw"&gt;&lt;/SPAN&gt;.id});&lt;BR /&gt;
}&lt;BR /&gt;
}}&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2024 13:09:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/query-array-in-optionlist-logic-for-networks/m-p/7250190#M3364</guid>
      <dc:creator />
      <dc:date>2024-04-26T13:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: Query array in optionlist logic for networks</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/query-array-in-optionlist-logic-for-networks/m-p/7250191#M3365</link>
      <description>&lt;ASIDE class="quote no-group" data-username="chopper" data-post="1" data-topic="1793"&gt;
chopper:
&lt;BLOCKQUOTE&gt;
&lt;P&gt;data.networks.labels&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;/ASIDE&gt;
&lt;P&gt;Hi Chopper,&lt;BR /&gt;
Certainly, please attempt to access the first element of the array using &lt;CODE style="background : #f0f1f2;"&gt;data.networks.labels[0]&lt;/CODE&gt;. This should provide the desired data from the array.&lt;/P&gt;
&lt;P&gt;Thanks&lt;BR /&gt;
Velan&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2024 14:10:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/query-array-in-optionlist-logic-for-networks/m-p/7250191#M3365</guid>
      <dc:creator />
      <dc:date>2024-03-26T14:10:16Z</dc:date>
    </item>
  </channel>
</rss>

