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

Community site session details

Session Id : s4f0XfY5waIApmW1NlPqLL
Power Apps - Building Power Apps
Answered

Split and Concat QR Code

Like (0) ShareShare
ReportReport
Posted on 14 Jun 2023 07:47:13 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?

I have the same question (0)
  • niel131512 Profile Picture
    14 on 31 Aug 2023 at 08:26:53
    Re: Split and Concat QR Code

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

     

  • GFFA Profile Picture
    18 on 31 Aug 2023 at 08:18:20
    Re: Split and Concat QR Code

    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 14 Aug 2023 at 10:36:56
    Re: Split and Concat QR Code

    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 21 Jun 2023 at 09:22:46
    Re: Split and Concat QR Code

    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; "*")

  • GFFA Profile Picture
    18 on 14 Jun 2023 at 11:30:44
    Re: Split and Concat QR Code

    Thank you so much!

  • Verified answer
    v-bofeng-msft Profile Picture
    on 14 Jun 2023 at 08:45:32
    Re: Split and Concat QR Code

    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

  • Verified answer
    GFFA Profile Picture
    18 on 14 Jun 2023 at 08:41:19
    Re: Split and Concat QR Code

    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.

  • v-bofeng-msft Profile Picture
    on 14 Jun 2023 at 08:04:14
    Re: Split and Concat QR Code

    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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 917 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 387 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 334 Super User 2025 Season 2

Last 30 days Overall leaderboard