web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Analysis of a barcode ...
Power Apps
Unanswered

Analysis of a barcode string and cut out parts

(0) ShareShare
ReportReport
Posted on by 9

Hi

 

I am trying to dissect a scanned GS1 barcode:

(01)08717694023322(17)250702(10)7748775(21)7748775020

| Articlenr: 14 digi         | Date: 6 digi  |Lotnr: variable| Serialnr: variable

 

As you may noticed i highlighted a few digits in bold, where is:

01: Article code, 17: date in yy/mm/dd format 10: Lotnr 21: serialnr

 

I am able to take the first bit apart that is the article code as it is always the prefix (01) followed by 14 digits so in my code i take away the 01 and keep the 14 digits string as an article code. I save the split string in a variable and here is were the problem begins.

 

I noticed in most barcodes the date with prefix (17) and 6 digits follows after the article code (01) 14 digits. In that case its easy to cut the date from the string as it is always 6 digits. In some barcodes the serialnr (21) follows after the article code (01). Here is where it gets tricky. The serialnr has a variable amount of digits. I can filter the restant of the string, after cutting off the article code (01), to search for the digits (17) and filter from there to the next prefix. But when the serialnr has a prefix in it i need some sort of logic to skip those 2 digits and continue to the next match of prefix based on a min max amount of characters. 

 

Did anybody ran in some sort of problem like this before of knows a topic on the net that could point me in the right direction. In my opinion this will never be 100% fail save if an amount of numbers to cut out have a variable amount and have a variable place. I need matching in the string but what when a string is 2121212121 as serial number that uses (21) as prefix. 

 

I am seriously brainfarting on this, i appreciate all the hints that could point me in the right direction!

 

Gr

Categories:
I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard