<?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 Looping stops if the number of devices selected is above 9 in ExtremeCloud IQ- Site Engine Management Center</title>
    <link>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/looping-stops-if-the-number-of-devices-selected-is-above-9/m-p/62431#M7656</link>
    <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I've been trying to do a &lt;A href="https://drive.google.com/file/d/1V3BAj5c03Q0ao--SGzkXruo79CHbyJ7e/view?usp=sharing" target="_blank" rel="nofollow noreferrer noopener"&gt;looping workflow&lt;/A&gt; where all devices do something one after the other, and not all at the same time. The objective behind that is to make two lists of devices, one where they have a specific VLAN, and one where it doesn't. With those two lists, I could make signals saying which are the devices without the wanted VLAN, and still continue with the rest of the workflow.&lt;BR /&gt;
&lt;BR /&gt;
For that, I came up with a loop, incrementing a number until it reaches the number of selected devices as the above limit. &lt;BR /&gt;
But, If the number of selected devices is greater or equal than 10, the loop doesn't work as intended anymore, and it stops after 2 loop turns.&lt;BR /&gt;
&lt;P class="fancybox-image"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="da9ed46ee2c84feda68e97164e858cf3_8336a71e-7b7a-4e12-9275-a046d01bed51.png"&gt;&lt;img src="https://community.extremenetworks.com/t5/image/serverpage/image-id/3797i9B0468F91299A370/image-size/large?v=v2&amp;amp;px=999" role="button" title="da9ed46ee2c84feda68e97164e858cf3_8336a71e-7b7a-4e12-9275-a046d01bed51.png" alt="da9ed46ee2c84feda68e97164e858cf3_8336a71e-7b7a-4e12-9275-a046d01bed51.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;BR /&gt;
I added the workflow variables &lt;B&gt;number&lt;/B&gt; and &lt;B&gt;maxNumber&lt;/B&gt;, as Number, and &lt;B&gt;devicesList&lt;/B&gt; as a String. &lt;BR /&gt;
&lt;BR /&gt;
The script named &lt;B&gt;Set variables&lt;/B&gt; as the following code :&lt;BR /&gt;
&lt;DIV class="threadCode"&gt;&lt;B&gt;code:&lt;/B&gt;&lt;PRE spellcheck="false"&gt;# set the initial value to 0&lt;BR /&gt;emc_results.put("number", "0")&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# Get the list of devices, only separated by a coma&lt;BR /&gt;devicesListRaw = emc_vars["devices"].encode('ascii', 'ignore')&lt;BR /&gt;devicesListRaw = devicesListRaw.replace("[", "")&lt;BR /&gt;devicesListRaw = devicesListRaw.replace("]", "")&lt;BR /&gt;devicesListRaw = devicesListRaw.replace(" ", "")&lt;BR /&gt;emc_results.put("devicesList", devicesListRaw)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# Set the maximum loop value to the number of selected devices&lt;BR /&gt;emc_results.put("maxNumber", str(len(devicesListRaw.split(","))))&lt;BR /&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BR /&gt;
The script named &lt;B&gt;Increment number&lt;/B&gt; as the following code :&lt;BR /&gt;
&lt;DIV class="threadCode"&gt;&lt;B&gt;code:&lt;/B&gt;&lt;PRE spellcheck="false"&gt;# Get values from the workflow variables&lt;BR /&gt;devicesListRaw = emc_vars["devicesList"].encode('ascii', 'encode')&lt;BR /&gt;deviceIP = emc_vars["deviceIP"].encode('ascii', 'ignore')&lt;BR /&gt;number = int(emc_vars["number"].encode('ascii', 'ignore'))&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# If the device's IP is in the list of all devices (as a string), &lt;BR /&gt;# increment number by 1.&lt;BR /&gt;if deviceIP in devicesListRaw:        &lt;BR /&gt;    print("Last number is : " + str(number))&lt;BR /&gt;    print("Max number is : " + str(maxNumber))&lt;BR /&gt;    number += 1&lt;BR /&gt;    # Set the new value of number into the variable&lt;BR /&gt;    emc_results.put("number", str(number))&lt;BR /&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BR /&gt;
Both conditions are on Custom :&lt;BR /&gt;
&lt;DIV class="threadCode"&gt;&lt;B&gt;code:&lt;/B&gt;&lt;PRE spellcheck="false"&gt;number &amp;lt; maxNumber       and         number &amp;gt;= maxNumber&lt;BR /&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BR /&gt;
The results of 9 and 10 devices are the following :&lt;BR /&gt;
&lt;DIV class="threadCode"&gt;&lt;B&gt;code:&lt;/B&gt;&lt;PRE spellcheck="false"&gt;       9 devices        |         10 devices&lt;BR /&gt;&lt;BR /&gt;Last number is : 8      |   Last number is : 1&lt;BR /&gt;Max number is : 9       |   Max number is : 10&lt;BR /&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Would anyone have an idea about why it's happening ?&lt;BR /&gt;
&lt;BR /&gt;
The version running is the : Extreme Management Center 8.2.4.55</description>
    <pubDate>Tue, 03 Sep 2019 21:03:06 GMT</pubDate>
    <dc:creator>Nealo</dc:creator>
    <dc:date>2019-09-03T21:03:06Z</dc:date>
    <item>
      <title>Looping stops if the number of devices selected is above 9</title>
      <link>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/looping-stops-if-the-number-of-devices-selected-is-above-9/m-p/62431#M7656</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I've been trying to do a &lt;A href="https://drive.google.com/file/d/1V3BAj5c03Q0ao--SGzkXruo79CHbyJ7e/view?usp=sharing" target="_blank" rel="nofollow noreferrer noopener"&gt;looping workflow&lt;/A&gt; where all devices do something one after the other, and not all at the same time. The objective behind that is to make two lists of devices, one where they have a specific VLAN, and one where it doesn't. With those two lists, I could make signals saying which are the devices without the wanted VLAN, and still continue with the rest of the workflow.&lt;BR /&gt;
&lt;BR /&gt;
For that, I came up with a loop, incrementing a number until it reaches the number of selected devices as the above limit. &lt;BR /&gt;
But, If the number of selected devices is greater or equal than 10, the loop doesn't work as intended anymore, and it stops after 2 loop turns.&lt;BR /&gt;
&lt;P class="fancybox-image"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="da9ed46ee2c84feda68e97164e858cf3_8336a71e-7b7a-4e12-9275-a046d01bed51.png"&gt;&lt;img src="https://community.extremenetworks.com/t5/image/serverpage/image-id/3797i9B0468F91299A370/image-size/large?v=v2&amp;amp;px=999" role="button" title="da9ed46ee2c84feda68e97164e858cf3_8336a71e-7b7a-4e12-9275-a046d01bed51.png" alt="da9ed46ee2c84feda68e97164e858cf3_8336a71e-7b7a-4e12-9275-a046d01bed51.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;BR /&gt;
I added the workflow variables &lt;B&gt;number&lt;/B&gt; and &lt;B&gt;maxNumber&lt;/B&gt;, as Number, and &lt;B&gt;devicesList&lt;/B&gt; as a String. &lt;BR /&gt;
&lt;BR /&gt;
The script named &lt;B&gt;Set variables&lt;/B&gt; as the following code :&lt;BR /&gt;
&lt;DIV class="threadCode"&gt;&lt;B&gt;code:&lt;/B&gt;&lt;PRE spellcheck="false"&gt;# set the initial value to 0&lt;BR /&gt;emc_results.put("number", "0")&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# Get the list of devices, only separated by a coma&lt;BR /&gt;devicesListRaw = emc_vars["devices"].encode('ascii', 'ignore')&lt;BR /&gt;devicesListRaw = devicesListRaw.replace("[", "")&lt;BR /&gt;devicesListRaw = devicesListRaw.replace("]", "")&lt;BR /&gt;devicesListRaw = devicesListRaw.replace(" ", "")&lt;BR /&gt;emc_results.put("devicesList", devicesListRaw)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# Set the maximum loop value to the number of selected devices&lt;BR /&gt;emc_results.put("maxNumber", str(len(devicesListRaw.split(","))))&lt;BR /&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BR /&gt;
The script named &lt;B&gt;Increment number&lt;/B&gt; as the following code :&lt;BR /&gt;
&lt;DIV class="threadCode"&gt;&lt;B&gt;code:&lt;/B&gt;&lt;PRE spellcheck="false"&gt;# Get values from the workflow variables&lt;BR /&gt;devicesListRaw = emc_vars["devicesList"].encode('ascii', 'encode')&lt;BR /&gt;deviceIP = emc_vars["deviceIP"].encode('ascii', 'ignore')&lt;BR /&gt;number = int(emc_vars["number"].encode('ascii', 'ignore'))&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# If the device's IP is in the list of all devices (as a string), &lt;BR /&gt;# increment number by 1.&lt;BR /&gt;if deviceIP in devicesListRaw:        &lt;BR /&gt;    print("Last number is : " + str(number))&lt;BR /&gt;    print("Max number is : " + str(maxNumber))&lt;BR /&gt;    number += 1&lt;BR /&gt;    # Set the new value of number into the variable&lt;BR /&gt;    emc_results.put("number", str(number))&lt;BR /&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BR /&gt;
Both conditions are on Custom :&lt;BR /&gt;
&lt;DIV class="threadCode"&gt;&lt;B&gt;code:&lt;/B&gt;&lt;PRE spellcheck="false"&gt;number &amp;lt; maxNumber       and         number &amp;gt;= maxNumber&lt;BR /&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BR /&gt;
The results of 9 and 10 devices are the following :&lt;BR /&gt;
&lt;DIV class="threadCode"&gt;&lt;B&gt;code:&lt;/B&gt;&lt;PRE spellcheck="false"&gt;       9 devices        |         10 devices&lt;BR /&gt;&lt;BR /&gt;Last number is : 8      |   Last number is : 1&lt;BR /&gt;Max number is : 9       |   Max number is : 10&lt;BR /&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Would anyone have an idea about why it's happening ?&lt;BR /&gt;
&lt;BR /&gt;
The version running is the : Extreme Management Center 8.2.4.55</description>
      <pubDate>Tue, 03 Sep 2019 21:03:06 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremecloud-iq-site-engine/looping-stops-if-the-number-of-devices-selected-is-above-9/m-p/62431#M7656</guid>
      <dc:creator>Nealo</dc:creator>
      <dc:date>2019-09-03T21:03:06Z</dc:date>
    </item>
  </channel>
</rss>

