<?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: Populate a variable based on results from query in Active IQ Unified Manager Discussions</title>
    <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Populate-a-variable-based-on-results-from-query/m-p/103774#M18362</link>
    <description>&lt;P&gt;This is easier than the earlier:&lt;/P&gt;&lt;P&gt;===&lt;/P&gt;&lt;P&gt;function returnShortName_copy(inputStr)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if( inputStr == "Computer1")&lt;BR /&gt;{&lt;BR /&gt;return "bob";&lt;BR /&gt;}&lt;BR /&gt;else if (inputStr == "Computer2")&lt;BR /&gt;{&lt;BR /&gt;return "fred";&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;return inputStr;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;=======&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sinhaa&lt;/P&gt;</description>
    <pubDate>Sat, 25 Apr 2015 04:09:50 GMT</pubDate>
    <dc:creator>sinhaa</dc:creator>
    <dc:date>2015-04-25T04:09:50Z</dc:date>
    <item>
      <title>Populate a variable based on results from query</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Populate-a-variable-based-on-results-from-query/m-p/103696#M18340</link>
      <description>&lt;P&gt;So, IHAC who has a long naming convention. &amp;nbsp;They include alot of short names for things. &amp;nbsp;I have all my querys for getting cluster, and aggr, and svm, but they want to use abbreviated names in the volume name for those. i.e. cluster1 = cl1_, cluster1 = cl2_ etc etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Beyond having dozens of copies of each command and using if statements to run them or not run them, is there a more straight forward way of achieving this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2025 04:30:21 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Populate-a-variable-based-on-results-from-query/m-p/103696#M18340</guid>
      <dc:creator>dblackwe</dc:creator>
      <dc:date>2025-06-05T04:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: Populate a variable based on results from query</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Populate-a-variable-based-on-results-from-query/m-p/103726#M18342</link>
      <description>&lt;P&gt;If the customer&amp;nbsp;has ( and they need to ) a consistent naming rule to obtain the short-names then this can be achieved using fucntions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Full names: cluster1, cluster2&lt;/P&gt;&lt;P&gt;Short Naming rule: the first 2 letters of the name and the last suffix and an&amp;nbsp;underscore&lt;/P&gt;&lt;P&gt;So abbrevated names&amp;nbsp;as you said&amp;nbsp;will be: cl1_ , cl2_&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can write a fuction to obtain the short-form names for this naming rule.&lt;/P&gt;&lt;P&gt;===&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;function returnShortName(inputStr)&lt;BR /&gt;{&lt;BR /&gt;int len = inputStr.length();&lt;BR /&gt;len--;&lt;BR /&gt;return inputStr.substring(0,2) + inputStr.substring(len) + "_"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;===&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Create a function with the above code and in your parameters for create volume, volume name field can call something like: returnShortName("cluster1") + "vol01"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So my volume name will be cl1_vol01. If you want add your Vserver too, just do it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sinhaa &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2015 11:02:03 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Populate-a-variable-based-on-results-from-query/m-p/103726#M18342</guid>
      <dc:creator>sinhaa</dc:creator>
      <dc:date>2015-04-24T11:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: Populate a variable based on results from query</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Populate-a-variable-based-on-results-from-query/m-p/103737#M18347</link>
      <description>&lt;P&gt;Sinhaa,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That is very helpful. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you show me what a function would look like that does a complete replace? &amp;nbsp;A bunch of if statements.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if $clusterName == Cluster1{&lt;/P&gt;&lt;P&gt;$clusShort=bob&lt;/P&gt;&lt;P&gt;}elsif $clusterName == Cluster2{&lt;/P&gt;&lt;P&gt;$clusShort=fred&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2015 15:21:38 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Populate-a-variable-based-on-results-from-query/m-p/103737#M18347</guid>
      <dc:creator>dblackwe</dc:creator>
      <dc:date>2015-04-24T15:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: Populate a variable based on results from query</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Populate-a-variable-based-on-results-from-query/m-p/103774#M18362</link>
      <description>&lt;P&gt;This is easier than the earlier:&lt;/P&gt;&lt;P&gt;===&lt;/P&gt;&lt;P&gt;function returnShortName_copy(inputStr)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if( inputStr == "Computer1")&lt;BR /&gt;{&lt;BR /&gt;return "bob";&lt;BR /&gt;}&lt;BR /&gt;else if (inputStr == "Computer2")&lt;BR /&gt;{&lt;BR /&gt;return "fred";&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;return inputStr;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;=======&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sinhaa&lt;/P&gt;</description>
      <pubDate>Sat, 25 Apr 2015 04:09:50 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Populate-a-variable-based-on-results-from-query/m-p/103774#M18362</guid>
      <dc:creator>sinhaa</dc:creator>
      <dc:date>2015-04-25T04:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: Populate a variable based on results from query</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Populate-a-variable-based-on-results-from-query/m-p/103857#M18379</link>
      <description>&lt;P&gt;This was exactly it. &amp;nbsp;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2015 15:25:00 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Populate-a-variable-based-on-results-from-query/m-p/103857#M18379</guid>
      <dc:creator>dblackwe</dc:creator>
      <dc:date>2015-04-28T15:25:00Z</dc:date>
    </item>
  </channel>
</rss>

