Home Powershell Activity

Get a value from SR to use in a P$A

Eric_EvansEric_Evans Member IT Monkey ✭

Hello,

I sincerely apologize if this has been answered.... I am looking to ask a question (ex. What is your favorite color?) I would then like to take that input and make it a variable to pass to a spreadsheet. I have mapped the input to the "notes" field of the form, but it doesn't seem to work. I am new at all this so some guidance would be appreciated.

Here is my attempt to just get the just the input and update the description (the example on the learning site, but using a variable instead of a static string):


param($Parent_Guid)

$Parent_WI = Get-SCSMObject -id $Parent_Guid

$Color = $Parent_WI.Notes

$Current_Description = $Parent_WI.Description

$New_Description = $Current_Description + $Color

Set-SCSMObject -SMObject $Parent_WI -Property Description -Value $New_Description


Am I even close?

Answers

  • Adam_DzyackyAdam_Dzyacky Product Owner Contributor Monkey ✭✭✭✭✭
    edited November 2020

    Hey there @Eric_Evans I just tried your PWSH with a Service Request template and it works.


    How have you mapped the parameter on the PowerShell Activity?

Sign In or Register to comment.