Powershell: Return values to the workflow

Hi, I am trying get a Powershell script to return field values to the workflow. The inverse process of

Could you please share your workflow, for better understanding.

Hi BhagyashriC.

There is no developed robotic process yet. There is some info that I need to get from the system that apparently can only be retrieved through a Powershell script. The point is that I understand how field values can be passed to Powershell but not back to the process.

I would like to return the following OS info to the process: UserProfileDirectory.


Willem de Jongh
T : +58 212 992 8876 x 011
M : +58 424 277 2290

You need to declare a variable in PSscript and declare it at the end.
Then you connect that variable to a specific Powershell Information. In this case, I used Enabled from the PS output.

If you want you can use a Modified JavaScript to see the Variable as a WF variable. It won’t appear in the input list, but it will be there.

PowerShell Script
$variable = Get-ADUser -Filter ‘Name -like “Fernando”’
Write-Host “<<>>Status::$status<<>>”

Here is a Sample Workflow. Hope It Helps.
WF_UsingPowerShell_Variables_Workflow.psw (15.0 KB)

Thanks for the information.

Actually Y tried to use the last line but suppose some items were missing.

I will work on this.


Thanks Fernando.

I still have trouble initiating the Workflows with Generate Rows. That was the whole issue.


You could try with another steps like “Data Grid” or “Get Variables” for initiating the workflows.

I have had some issues using Get Variables as the first step before some Ready Actions, that were solved using Data Grid or Generate Rows. One of them was Read Mail.

With the solution of the PowerShell script, there is no info of the fields returned and could not modify the values within a Javascript or other RA. Finally passed the received info to variables and recall it a second workflow.

Hi Again with a Powershell issue.
Trying to get back numbers from powershell which I need to calculator other values to estimate information location on my screen. Depending on screen dimensions, coordinate should change.
But Powershell seem to include some hidde character which I have not been able to filter out so I can do my algoritms.
Any idea on how to manage this, in powershell or plugin?
Attached my little workflow.WF_Token_inicialización.psw (16.5 KB)

Found how to normalize data in memory when using Powershell return variables.
Define the variables you expect to receive from Powershell within Generate Rows single row. In below example PS_Width and PS_Height.
Return variables within Powershell. Example Below
Write-Host “<<>>PS_Width::$Width<<>>”
Write-Host “<<>>PS_Height::$Height<<>>”
Workflow will receive the values from the Write-Host but leaves other 2 variables in memory without reference.
Use Step: Rename-Fields and leave only the variables declared in the Generate Rows. This will clean up dirty memory.
From here on, you can use the info in your operations without mixup.WF_Token_inicialización.psw (16.1 KB)

1 Like