Community maintenance is complete. Thank you for your patience!

Active IQ Unified Manager Discussions

variables usable for each command

berhei

Hello

 
is there a way to declare and define a variable (e.g. $Username) which can be used in every command of a workflow without using it as user input?
 
Thanks and best regards
berhei
6 REPLIES 6

sinhaa

This feature of global user inputs is not available in WFA as yet. But you can do it by a workaround by defining a function that returns the value of the Parameter that you would want.

---

def param (username)
{
return "sinhaa";
}

----

 

Now you can call this fuction in any workflow in any command parameter.

 

 

sinhaa

 

 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

berhei

Thank you sinhaa.

 

This solves one problem 🙂

Is there any way I can set the username and retrive it later?

 

Best regards.

 

sinhaa

Ahh.. you need to give clear details about what exactly are you trying to do. These one liners riddles will not help me give an accurate answer.

 

Kindly explain what are you looking to achieve with some degree of detail.  

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

berhei

@sinhaa wrote:

Ahh.. you need to give clear details about what exactly are you trying to do. These one liners riddles will not help me give an accurate answer.

 

Kindly explain what are you looking to achieve with some degree of detail.  


 

Ok sorry, I'll do my best.

 

I need a variable (e.g. $VolumeName) which is accessible the same way a user input is accessible. E.g. in a Filter or another query.

The workaround with the function will work when I want to receive the value of $VolumeName.

 

So during run time of the Workflow I want to compute the value for $VolumeNameand set $VolumeName to the computed value. E.g. Using a Query.

And then I want to use the value of $VolumeNamein a Filter.

 

So the question is how can I declare set $VolumeName and access it in such an "semi-global" way?

 

I am hoping this explains enough. Thank you in advance.

sinhaa

No, sorry I still didn't get it. Give some clear example.

 

The function denifinition gives you a global contant, they can be used in filters, command parameters anywhere and in any workflow. 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

trentino123

You can also use a CONSTANT.

 

In the Setup->Constants .

 

That is not a user input, fixed for every command in the workflow.

 

Whenever you change that constant value, the input on every command will refer to the new value.

 

So you always use the constant names in the command, but you change the value only once.

 

Hope that helps.

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public