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

Announcements

News and Announcements icon
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:

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 330

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard