W00T! I was able to get this to work. I think my problem was that I was trying to find a dynamic way of doing what I had previously been doing with the Multi Question. The Multi Question only allows for Boolean variables for input and that was my mistake. I was trying to use a dynamically generated list of these variables to determine if I should run the build on each Server Class. That just won’t work (without a variable set as I talked about in my earlier post).
In my determination to do this however, I discovered that the Prompt for Variables (Enhanced) action lets you use a check list for input. When I saw that I was like “Hey! I wonder if they let you enter in multiple values delimited with a CrLF, and store it as a pseudo-array?” Bingo!
I was able to knock this out with 3 actions:
1. File Contents Iterator Action. This iterates over a file (generated from a previous action) which lists all of the possible server classes I could run the build on.
a. Set ServerClass variable.
b. Run Script Action:
If strSCArr = "" Then
strSCArr = ServerClass
Else
strSCArr = strSCArr & vbCrLf & ServerClass
End If
2. Prompt for Variables (Enhanced).
a. Action: The variable I am prompting for is strSCArr. I have its type defined as “Check List” and its values as %strSCArr% (which was set above)
b. AfterAction Script:
Const ForReading = 1, ForWriting = 2, ForAppending = 8, TristateFalse = 0
Dim objFSO, oSCFile, arrSC, i, strSC
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set oSCFile = objFSO.OpenTextFile(strFBTmpDir & "\" & strListBldServerClass , ForWriting, True, TristateFalse)
arrSC = Split(strSCArr,vbCrLf)
For i = 0 To UBound(arrSC)
oSCFile.WriteLine arrSC(i)
Next
The file name stored in strListBldServerClass is the same one that I iterated over in step one.
So you can see, this actually pretty simple after all if you use the correct variable type.