Skip to main content

Needing to copy and paste one field record into an empty column, and replace all instances of " " with "-"

  • September 17, 2021
  • 1 reply
  • 12 views

Hey everyone! I’m trying to create a script that will read whatever content is placed into the first column “Product Title” and create a url handle out of it. I’m just looking for it to copy whatever record is under “Product Title” to “Handle” and replace all instances of spaces with “-” instead. Thanks so much!

1 reply

Alexey_Gusev
Forum|alt.badge.img+25
  • Brainy
  • 1261 replies
  • September 17, 2021

Hi,

use formula SUBSTITUTE(“Products title”, " ", “-”).
then turn formula field in Text(if needed)

or (if exactly script needed) use mine from here, change field names, add replacement to
rec.getCellValue(‘ source ’)

rec.getCellValue(‘ source ’).replace (/ /g,"_");
(g means all occurencies)