<?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 Working with Variables in Active IQ Unified Manager Discussions</title>
    <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Working-with-Variables/m-p/50732#M10473</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I’m working on my first WFA development project and have ran into a hurdle I can’t seem to jump over. I ‘m looking for the way to take a location a user specifies and turn it into a local cluster name.&amp;nbsp; From there I’ll be selecting an aggregate to create a new volume in for a new VMware datastore. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created the short bit of code below to translate datacenter location to the correct site cluster name as a couple sites have multiple cluster but only one for VMware.&amp;nbsp; My issue is feeding this newly assigned cluster name into the rest of the workflow so it uses the $ClusterName variable specified below throughout the workflow.&amp;nbsp; I’m not necessarily looking for a complete solution but rather the general way to make this work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;param (&lt;/P&gt;&lt;P&gt; [parameter(Mandatory=$false, HelpMessage="Datacenter Location")]&lt;/P&gt;&lt;P&gt;&amp;nbsp; [string]$DCLocation,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt; [parameter(Mandatory=$false, HelpMessage="Name of Cluster")]&lt;/P&gt;&lt;P&gt;&amp;nbsp; [string]$ClusterName &lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if ($DCLocation = 'Valley Forge') &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {$ClusterName = 'Amazon'} &lt;/P&gt;&lt;P&gt;elseif ($DCLocation = 'Denver') &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {$ClusterName = 'Phoenix'} &lt;/P&gt;&lt;P&gt;elseif ($DCLocation = 'Ft. Worth') &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {$ClusterName = 'Griffin'}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Jun 2025 05:29:25 GMT</pubDate>
    <dc:creator>knorman</dc:creator>
    <dc:date>2025-06-05T05:29:25Z</dc:date>
    <item>
      <title>Working with Variables</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Working-with-Variables/m-p/50732#M10473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I’m working on my first WFA development project and have ran into a hurdle I can’t seem to jump over. I ‘m looking for the way to take a location a user specifies and turn it into a local cluster name.&amp;nbsp; From there I’ll be selecting an aggregate to create a new volume in for a new VMware datastore. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created the short bit of code below to translate datacenter location to the correct site cluster name as a couple sites have multiple cluster but only one for VMware.&amp;nbsp; My issue is feeding this newly assigned cluster name into the rest of the workflow so it uses the $ClusterName variable specified below throughout the workflow.&amp;nbsp; I’m not necessarily looking for a complete solution but rather the general way to make this work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;param (&lt;/P&gt;&lt;P&gt; [parameter(Mandatory=$false, HelpMessage="Datacenter Location")]&lt;/P&gt;&lt;P&gt;&amp;nbsp; [string]$DCLocation,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt; [parameter(Mandatory=$false, HelpMessage="Name of Cluster")]&lt;/P&gt;&lt;P&gt;&amp;nbsp; [string]$ClusterName &lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if ($DCLocation = 'Valley Forge') &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {$ClusterName = 'Amazon'} &lt;/P&gt;&lt;P&gt;elseif ($DCLocation = 'Denver') &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {$ClusterName = 'Phoenix'} &lt;/P&gt;&lt;P&gt;elseif ($DCLocation = 'Ft. Worth') &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {$ClusterName = 'Griffin'}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2025 05:29:25 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Working-with-Variables/m-p/50732#M10473</guid>
      <dc:creator>knorman</dc:creator>
      <dc:date>2025-06-05T05:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Variables</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Working-with-Variables/m-p/50737#M10474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi knorman,&lt;/P&gt;&lt;P&gt;If the version of WFA that you are using is 2.2, you can make use of the powershell commandlets Add-WfaWorkflowParameter and Get-WfaWorkflowParameter. These will help you to add a parameter in one of the commands, which can then be accessed in any of the commands that follow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will have add "ClusterName" as a parameter in the command where you are translating the DCLocation to ClusterName in the following manner:&lt;/P&gt;&lt;P&gt;$ParameterName = "ClusterName"&lt;/P&gt;&lt;P&gt;$ParameterValue = $ClusterName&lt;/P&gt;&lt;P&gt;Add-WfaWorkflowParameter -Name $ParameterName -Value $ParameterValue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can then get this parameter in the other command codes in the following way:&lt;/P&gt;&lt;P&gt;$ParameterName = "ClusterName"&lt;/P&gt;&lt;P&gt;$val = Get-WfaWorkflowParameter -Name $ParameterName&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: You will not be able to access $ClusterName in other places in the workflow such as filters/loops. This variable will be scoped at command level only.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 04:42:13 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Working-with-Variables/m-p/50737#M10474</guid>
      <dc:creator>dhruvd</dc:creator>
      <dc:date>2014-09-03T04:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Variables</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Working-with-Variables/m-p/50742#M10475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Norman,&lt;/P&gt;&lt;P&gt;What you are really trying to do is resource selection based on location of the user who invoke the workflow.&lt;/P&gt;&lt;P&gt;For this you you will somehow need do a mapping of the location to user to resource. In such situation we generally recommend to use playground database to do such persistent mapping.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"&gt;If the mapping is mostly static, then you can use a playground DB and store the mapping from location to cluster name&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"&gt;Or, you could use a function to return cluster name given the location and then use that to load the “Cluster by key” in a no-op command&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"&gt;After that the rest of the workflow can use the cluster variable where it would be properly filled i.e cluster.name&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"&gt;Other way is&lt;/SPAN&gt;&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"&gt;Store in playground DB the mapping&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"&gt;First user input can be location $Location&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"&gt;Once chosen, the next locked query based user input named $ClusterName will be based on $Location (This is query based, but will always have single item in drop-down)&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"&gt;Solution Courtesy, Shailaja&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"&gt;adai&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 05:57:21 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Working-with-Variables/m-p/50742#M10475</guid>
      <dc:creator>adaikkap</dc:creator>
      <dc:date>2014-09-03T05:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Variables</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Working-with-Variables/m-p/91503#M17033</link>
      <description>&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; There was a previous conversation that included something that would solve your problem with a function. With a function you can create this sort of hash map.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;def regionMap(region) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; return ['Americas' : 'am', 'EMEA' : 'em', 'APAC' : 'ap', 'Switzerland' : 'ch', 'Singapore' : 'sn', 'Hong Kong' : 'hk'].get(region);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;def locationMap(location) {&lt;/P&gt;&lt;P&gt;return ['Singapore':'sg','Tokyo':'tk','Sydney':'sy','Hong Kong':'hk','New York':'ny','London':'ln','Pune':'pn','Mumbai':'mu','Jakarta':'jk','Seoul':'se','Bangkok':'bk','Shanghai':'sh','Kuala Lumpur':'kl','Beijing':'bj','Taipei':'tp','Bangalore':'bg','Atlanta':'at','Boston':'bs','Buenos Aires':'ba','Calgary':'cg','Cayman Islands':'ci','Chicago':'cc','Dallas':'da','Houston':'hs','Las Angeles':'la','Mexico':'mx','Miami':'mi','Philadelphia':'ph','Raleigh':'ra','San Francisco':'sf','Toronto':'to','West Palm Beach':'wp','Paris':'pa','Dubai':'du','Doha':'do','Dublin':'db','Poland':'po','Madrid':'md','Milan':'ml','Turkey':'tu'].get(location);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To call it in your workflow you can simply use&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(String)(regionMap($region)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;volumeName&lt;/P&gt;&lt;P&gt;if ( $workflowMethod == 'Specified' ) { return ($INPUT_Volume) } else { return 'v' + (String)(regionMap($region)) + (String)(businessUnitMap($bu)) + (String)(useCaseMap($useCase)) }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;vfilerName&lt;/P&gt;&lt;P&gt;if ( $workflowMethod == 'Specified' ) { return ($INPUT_VfilerName) } else { return 'vf' + (String)(regionMap($region)) + (String)(businessUnitMap($bu)) + (String)(useCaseMap($useCase)) + (String)(environmentMap($env)) }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Oct 2014 15:11:05 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Working-with-Variables/m-p/91503#M17033</guid>
      <dc:creator>olson</dc:creator>
      <dc:date>2014-10-08T15:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Variables</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Working-with-Variables/m-p/91723#M17034</link>
      <description>&lt;P&gt;In the workflow setup, I would add 2 CONSTANTS, 1 is the LOCATION and another is the CLUSTER. Both have a string separated by commas ( they are an array ).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LOCATION = "location1,location2,location3,location4"&lt;/P&gt;&lt;P&gt;CLUSTER = "cluster1,cluster4,cluster1,cluster1"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then with a function we could get an index number of the location and place then place the cluster in a variable ( CLUSTER ) we could use to list the aggregates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Oct 2014 15:07:48 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Working-with-Variables/m-p/91723#M17034</guid>
      <dc:creator>trentino123</dc:creator>
      <dc:date>2014-10-09T15:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Variables</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Working-with-Variables/m-p/91845#M17039</link>
      <description>&lt;P&gt;If working with a CSV file is not a problem ( to have a new datasource you could use in your SQL queries within the user inputs ), here is a 5min video that explains how to do it :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="http://community.netapp.com/t5/OnCommand-Storage-Management-Software-Articles-and-Resources/Video-Building-your-first-script-based-custom-datasource-using-a-file/ta-p/87679"&gt;http://community.netapp.com/t5/OnCommand-Storage-Management-Software-Articles-and-Resources/Video-Building-your-first-script-based-custom-datasource-using-a-file/ta-p/87679&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Oct 2014 20:21:44 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Working-with-Variables/m-p/91845#M17039</guid>
      <dc:creator>trentino123</dc:creator>
      <dc:date>2014-10-09T20:21:44Z</dc:date>
    </item>
  </channel>
</rss>

