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

Shorten number string

Community Beginner ,
Feb 19, 2021 Feb 19, 2021

Copy link to clipboard

Copied

I am trying to create an Adobe form for use in a mailroom for package tracking numbers.  The person using the form will utilize a barcode scanner to receive packages from all different carriers (FedEx, UPS, USPS etc)

 

When scanning the barcode on a FedEx label, it populates a 34 digit string of numbers where only the last 12 digits are the actual tracking number.  I would like to use some sort of script within certain text fields to remove the first 22 digits (and only display the last 12).  I am a novice with Javascript and any help is much appreciated. 

 

In addition, if there is a way to use part of the number sequence to identify between FedEx Ground and FedEx Express, that would be awesome

Views

497

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 2 Correct answers

Community Expert , Feb 19, 2021 Feb 19, 2021

The question is whether the scan process triggers the normal events that are triggered when entering a value into a field.

If so, you can do it using this code as the field's custom calculation script:

 

if (event.value) event.value = event.value.substr(-12);

Votes

Translate

Translate
Community Beginner , Feb 21, 2021 Feb 21, 2021

What do you mean by normal events?  The plan is that the scanner will input the numeric sequence of the barcode followed by a tab key to advance to the next field. 

Votes

Translate

Translate
Community Expert ,
Feb 19, 2021 Feb 19, 2021

Copy link to clipboard

Copied

The question is whether the scan process triggers the normal events that are triggered when entering a value into a field.

If so, you can do it using this code as the field's custom calculation script:

 

if (event.value) event.value = event.value.substr(-12);

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
Community Beginner ,
Feb 21, 2021 Feb 21, 2021

Copy link to clipboard

Copied

What do you mean by normal events?  The plan is that the scanner will input the numeric sequence of the barcode followed by a tab key to advance to the next field. 

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
Community Expert ,
Feb 22, 2021 Feb 22, 2021

Copy link to clipboard

Copied

Just try it and see if it works.

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
Community Beginner ,
Feb 22, 2021 Feb 22, 2021

Copy link to clipboard

Copied

LATEST

It worked perfectly, thank you

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