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

TOPICS
Comment review and collaborate PDF

Views

65

Likes

translate

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

Most Valuable Participant , 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);

Likes

translate

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. 

Likes

translate

Translate

Translate
Most Valuable Participant ,
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);

Likes

translate

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. 

Likes

translate

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
Most Valuable Participant ,
Feb 22, 2021 Feb 22, 2021

Copy link to clipboard

Copied

Just try it and see if it works.

Likes

translate

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

It worked perfectly, thank you

Likes

translate

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