Agent action to remove a whitespace and combining 1st 2 words in $Name


(Tom Diaz) #1

Hi

I am trying to remove a whitespace between the first 2 words in the $Name and combine them.

Ex: Word1 Word2 change to Word1Word2

I am using the replace command in an Agent action and it is not working. Here is my code:

Agent: is finding the right notes but the agent action is failing:

Agent Action
$Name.replace("^Word1 Word2",“Word1Word2”);

Thanks in advance
Tom


(eastgate) #2

You want

$Name=$Name.replace(…)

.replace returns the modified string; you could replace something from one attribute and store the result in another without changing the original value.


(Tom Diaz) #3

Thanks Mark. So obvious after someone points it out.

Tom