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 / Split and Concat QR Code
Power Apps
Unanswered

Split and Concat QR Code

(0) ShareShare
ReportReport
Posted on by 18

Hello,

 

I have the following problem and can not come up with a solution.
I scan several QR codes in a row with an external QR code scanner. This has the following syntax:
Type(Order(Customer(Supplier(
The code could look like this:
Type1(Order1(Customer1(Supplier1(Type2(Order2(Customer2(Supplier2(Type3(Order3(Customer3(Supplier3(

I scan the QR - Code in DataCardValue46_1.

I want to split this into a collection and then merge e.g. all customers with a separator. If the customer name is repeated, I would like to have this displayed only 1x.

Can someone help me here please?

Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    on at

    Hi @GFFA ,

     

    Please try:

    With(
     {TheCollection:
    With(
     {TheString:"Type1(Order1(Customer1(Supplier1(Type2(Order2(Customer2(Supplier2(Type3(Order3(Customer3(Supplier3("},
     ForAll(
     Sequence(RoundDown(CountRows(Split(TheString,"("))/4,0),0,1),
     {
     Type:Index(Split(TheString,"("),Value*4+1).Value,
     Order:Index(Split(TheString,"("),Value*4+2).Value,
     Customer:Index(Split(TheString,"("),Value*4+3).Value,
     Supplier:Index(Split(TheString,"("),Value*4+4).Value
     }
     )
    )},
     ForAll(
     Distinct(TheCollection,Customer).Value,
     LookUp(TheCollection,Customer=Value)
     )
    )

     

    Best Regards,
    Bof

  • Verified answer
    GFFA Profile Picture
    18 on at

    Hi Bof,

    thank you very much for your support.

    I haven't been developing PowerApps for very long and can't understand the exact function of your code.
    Can i change "TheString" to: DataCardValue46_1.Text?

    With(
     {TheCollection:
    With(
     {TheString:"Type1(Order1(Customer1(Supplier1(Type2(Order2(Customer2(Supplier2(Type3(Order3(Customer3(Supplier3("},
     ForAll(
     Sequence(RoundDown(CountRows(Split(TheString,"("))/4,0),0,1),
     {
     Type:Index(Split(TheString,"("),Value*4+1).Value,
     Order:Index(Split(TheString,"("),Value*4+2).Value,
     Customer:Index(Split(TheString,"("),Value*4+3).Value,
     Supplier:Index(Split(TheString,"("),Value*4+4).Value
     }
     )
    )},
     ForAll(
     Distinct(TheCollection,Customer).Value,
     LookUp(TheCollection,Customer=Value)
     )
    )

    Where do I have to insert the code or how can I get my desired values out then?
    The goal is to field the data in a form and then safe it in a sharepoint lists.

  • Verified answer
    v-bofeng-msft Profile Picture
    on at

    Hi @GFFA ,

     

    Add a button and set it's OnSelect property to

    ClearCollect(
    CollectionName,
    With( {TheCollection: With( {TheString:DataCardValue46_1.Text}, ForAll( Sequence(RoundDown(CountRows(Split(TheString,"("))/4,0),0,1), { Type:Index(Split(TheString,"("),Value*4+1).Value, Order:Index(Split(TheString,"("),Value*4+2).Value, Customer:Index(Split(TheString,"("),Value*4+3).Value, Supplier:Index(Split(TheString,"("),Value*4+4).Value } ) )}, ForAll( Distinct(TheCollection,Customer).Value, LookUp(TheCollection,Customer=Value) ) ))

    Click the button ,you will get the collection you want.

     

    Best Regards,

    Bof

  • GFFA Profile Picture
    18 on at

    Thank you so much!

  • GFFA Profile Picture
    18 on at

    Hello Bof,

    I have another question about the code.
    This removes the whole lines for duplicates. Now my application uses multiple orders from the same customer but with different types. I have now removed the lower part of your function.

    Is there any way that I can use the Concat function to join all values except Duplicate?
    Trying this Function did not work:
    Concat(Distinct(Collectionname;Order);Order; "*")

  • niel131512 Profile Picture
    14 on at

    May i know how do you setup the external qr code?and which external qr code did you use..i wanted to try to use an external qr code but im not sure if it is compatible to use for my powerapps..

  • GFFA Profile Picture
    18 on at

    I receive the QR code from an external company as a DataMatrix. The syntax is "Type1(Order1(Customer1(Supplier1(". I scan the QR codes into a text field and split them with a push bu

  • niel131512 Profile Picture
    14 on at

    sorry,,what i meant was how do you setup the external qr code scanner?and which qr code scanner did u use?

     

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard