cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ALDY_
Frequent Visitor

Remove part of qr code scan result

Hi community,

I would like to scan mutliple QR Codes and store a part of the result in a collection.

The result of the scan is that : FL2019W49200805 FFE20FD1

I want to keep only the last part (FFE20FD1).

How can i do that ? The function Right( String, NumberOfCharacters ) do exactly what i want but don't work with numbers.

 

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @ALDY_ ,

If your scan is always the same number of characters

Mid(YourScanCode,18,8)

or if you want everything right of the space

With(
   {wScan: YourScanCode},
   Right(
      wScan,
      Len(wScan) - Find(
         " ",
         wScan
      )
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

7 REPLIES 7
WarrenBelz
Super User
Super User

Hi @ALDY_ ,

If your scan is always the same number of characters

Mid(YourScanCode,18,8)

or if you want everything right of the space

With(
   {wScan: YourScanCode},
   Right(
      wScan,
      Len(wScan) - Find(
         " ",
         wScan
      )
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

ALDY_
Frequent Visitor

Hi,

Thanks for your reply @WarrenBelz 

The scan is always the same number of characters so the first formula should be fine.

Here is my OnScan action parameter :

ALDY__0-1627539523188.png

 

 

Collect(Collection1; {'ID du Capteur':BarcodeScanner1.Value})

 

 

 Can i use the Mid function directly on the BarcodeScanner1.Value in this parameter?

I tried different syntax but it didn't work.

 

 

This doesn't work?

 

Collect(Collection1; {'ID du Capteur':Mid(BarcodeScanner1.Value,18,8)})

@ALDY_ ,

To correctly apply the @WarrenBelz solution use: 

 

Mid(YourScanCode;18;8)

 

 

Please check @WarrenBelz response as solution !

ALDY_
Frequent Visitor

Hi @BCBuizer,

No, the detailled info says "an operator was expected"

ALDY__0-1627544259209.png

 

@ALDY_ ,

Your region needs

ClearCollect(
   Collection1;
   {
      'ID du Capteur':
      Mid(
         BarcodeScanner1.Value;
         18;
         8
      )
   }
)

You will need to become accustomed to changing commas , for semi-colons ; and single semi-colons ; for two of them ;; as the is the format in some European countries.

 

 

ALDY_
Frequent Visitor

It works, thanks !

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,296)