Is it possible to get the "If Variable Defined" action to only execute child actions if a variable is defined AND (here's the new part) it also equals some value.
-Matt
Is it possible to get the "If Variable Defined" action to only execute child actions if a variable is defined AND (here's the new part) it also equals some value.
-Matt
Hi Matt,
You can’t do both checks in the ‘If Variable Defined’ action, you’ll need to use a separate ‘If…Then’ action to perform the comparison.
Regards,
Paul.
Ok, thanks. So then my next question is how do I use a dyanmic variable in an IF action.
I have a variable like %VariableName%, and I want to check if it's value equals something
In the "If variable defined" action it expands %VariableNmae% to the actaul variable, but I'm not sure how to do that in the IF action.
-Matt
Hi Matt,
To compare the value of the variable in the If…Then action you simply specify the variable surrounded by ‘%’. For example:
Left-Hand Value: %VariableName%
Right-Hand Value: ValueToBeCompared
Regards,
Paul.
I don't think I explained it well enough.
Let's say I have 3 variables defined. DeployApp1, DeployApp2, BuildingApp
DeployApp1& 2 are boolean and control if an application needs to be deployed. BuildingApp is a paramater that's passed in to tell us what is currently building. It's value will be App1 or App2.
I want to dynamically update the variable name used in the If statment based off which app was passed in thru the BuildingApp variable. So the Left-Hand side is something like Deploy%BuildingApp% and the Right-Hand side is True.
Problem is the If statement always fails because it ends up checking something like DeployApp1 = True. When I really wanted DeployApp1's value on the Left-Hand side.
So I think that's a better example. Is this possible? Maybe I should just try something like %Deploy%BuildingApp%%
-Matt
Hi Matt
What you are trying to do will not work due to how variables are parsed and expanded.
Let me step back and explain what I'm trying to do. Maybe their's a much better way to do it.
In FB Server I have a project that builds a Visual Studio 2008 solution with multiple executables in it. I want the FB Server project to have a checkbox for each executable in the solution. So it looks like this.
We only want the projects that are checked to be deployed when the project runs.It would be easy to use hardcoded variables in the FB Project and just create a If action to check each one, but as this list will continaully grow I'd like to figure out how to do it dynamically.
So in the FB project I'm trying something like this.
I have a folder iterator which loops thru all of the executables in the solution. The folder names match the variable names, so we actually have a folders named AWSApplicationPersistance, EHealthApplicationMapping, and ThirdParty. So what I want to do is add an IF Action that uses the current folder's name from the folder iterator as a pointer to the checkbox variable to see if we should deploy that folder. So basically in the If statement I have a variable called CurrentFolder who's value is actually the name of another variable that is either ture or false, it's those checkboxes.
Hi Matt,
I've attached an example project which should do what you're trying to achieve (I hope).
Regards,
Paul.
And here is my example for creating a Dynamical List, Just change the Iterator to Folder Iterator.
Daphna Levin
TestDynamicList.fbz6 (2.777 KB)Thanks Paul,
That's was exactly what I was looking for.
-Matt