Removing unwanted text from selector

Hi all! I'm attempting to create a snippet for changing a SalesForce case to my department. I need to add the account name into my snippet and add it together with the title of my department in the subject. This has to be done in SF Classic.
My problem is that I've not been able to pull the account name from the account name field in account information in the case edit screen. I have been successful in pulling it from the Account name on the sidebar, but it will add the [View Hierarchy] Screen Shot 2022-02-15 at 6.19.40 PM
after the name. I've thought that maybe there would be a way to remove that before it's inserted?

If I can get this figured out it will save me a lot of copy/paste and typing. Thanks in advance!

{time: MM-DD-YY} - LE - Please see notes in case feed.{key: tab}{key: tab}{key: tab}{key: tab}{key: tab}{key: tab}{key: tab}{site: text; selector=.quickActionForm > :nth-child(1) > :nth-child(1) .quickActionFieldElement} - DoorDash POS Techinical Support

2 Likes

Hi @Santa_Laren
Try replacing {site: text; selector=....} with {=replace({site: text; selector=.quickActionForm > :nth-child(1) > :nth-child(1) .quickActionFieldElement}, " [View Hierarchy]", "")}

1 Like

Thanks Dan. I tried that just now and it didn't change things.

1 Like

Never mind!! I got it working! Thank you @Dan_Barak1 So much! :star_struck:

1 Like