Help with Powershell script :)

Hello all,

I hope you are well ;)

I have a very stupid question about a script.

I have a Workflow that modifies attributes of a user.

For certain I have to delete a character string.

For example:
Description = "HELLO WORLD"

I must have after running the script:
"HELLO"

I set up a script:
function update ($ Request)
{
$ DescriptionOld = $ Request.Get ("Description")
    $ DescriptionNew = $ DescriptionOld.Replace ("- EXT", "")
    
    return $ DescriptionNew
    
}

I add the script in an update action of the workflow.

And on execution I have the following error in the Change History:
You cannot call a method on a null-valued expression.

Do you have any idea what is wrong?

Thank you in advance for your help.

Take care of you ;)
Parents Reply Children
No Data