• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

JavaScript Needed - Remove digits from beginning and end

Explorer ,
Jun 15, 2022 Jun 15, 2022

Copy link to clipboard

Copied

Hello Smarter Than Me People...  I have a field (ID Field) that will populate a 9 digit number.  I need that number to populate into another field (New ID) without the first digit and last 2 digits.  Any chance someone can help me out with the JavaScript for this?

TOPICS
JavaScript

Views

180

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jun 15, 2022 Jun 15, 2022

As the custom calculation script of "New ID" enter the following:

var oldId = this.getField("ID Field").valueAsString;
if (oldId.length==9) event.value = oldId.substr(1,6);
else event.value = "";

Votes

Translate

Translate
Community Expert ,
Jun 15, 2022 Jun 15, 2022

Copy link to clipboard

Copied

LATEST

As the custom calculation script of "New ID" enter the following:

var oldId = this.getField("ID Field").valueAsString;
if (oldId.length==9) event.value = oldId.substr(1,6);
else event.value = "";

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines