Hello, tell me, can I
data from the script
with "PowerShell Script Action"?
data to a script
var1-var5. But if, for
a variable in the script
$ var1 = "Hello word",
then the variable
process mapped to
does not change.
Same problem here.
In the documentation for the PowerShell Script Action (http://ilovesharepoint.codeplex.com/wikipage?title=Execute%20PowerShell%20Script%20Action&referringTitle=Workflow%20Actions%20for%20SharePoint%20Designer%202010)
is written that the binding is two way, so it should work. But the var1-var5 don't get written back to the associated worklow variables.
Okay, got it to work.
You have to consider two things:
- Use the global context of the variable:
$global:var1 = "value"
- If all you need is a string you are okay, if not, convert the value to a string.
Here you have to be very carefully, because if you then assign the worflow variable again to a float or datetime, than the variable has to be in a culture specific format.
$value = 0.33
$culture = [System.Globalization.CultureInfo]::CurrentCulture
$global:var = $value.ToString($culture) #0,33 if you live in a country with a decimal comma