Skip to main content
Solved

Script to get the first nine characters of a field

  • April 14, 2021
  • 4 replies
  • 64 views

Forum|alt.badge.img+7

I’m hoping to get the first 9 characters of a record into another field. Id normally just make the field into a formula and use Left({product},9) but the rest of the automation wont run on the formula field.

Please help.

Best answer by Justin_Barrett

Another option is to use an “Update record” action to copy the result from the formula field to a single line text field, then use that value later in the automation.

4 replies

Kamille_Parks11
Forum|alt.badge.img+27

In javascript you’d do: variableName.substring(0, 8)

https://www.w3schools.com/jsref/jsref_substring.asp


Justin_Barrett
Forum|alt.badge.img+21
  • Inspiring
  • 4647 replies
  • Answer
  • April 14, 2021

Another option is to use an “Update record” action to copy the result from the formula field to a single line text field, then use that value later in the automation.


Forum|alt.badge.img+7
  • Author
  • Inspiring
  • 9 replies
  • April 14, 2021

Thanks Justin, that worked a treat.


Justin_Barrett
Forum|alt.badge.img+21
  • Inspiring
  • 4647 replies
  • April 15, 2021

Glad to know that you got the answer you were seeking! If you would, please mark my comment (the one above, not this one) as the solution to your question. This helps others who may be searching with similar questions. Thanks!