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

how to pass the value to multiple text input controls after running codes ?

hi All

          I have one EditFom with BarocdeScanner (button) and some text input , when I scanned E-Invoice QR code , I need split scannedString to different strings and pass to different Text input  in the same form, now my issue are :

         1. my BarcodeScanner can scan the QR code and pass the scannedString to one of the text input (named: txtScannedString).

         2. if I used Split function to do that, how to access the values after splited and pass these information to other text input ?

 

         I tried to use onChange property to do it, but not successful.

 

       can someone give me a direction ?

  

       thanks in advance!

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Support
Community Support

Re: how to pass the value to multiple text input controls after running codes ?

Hi @wht_629 ,

 

Try to Set the OnScan property of BarcodeScanner as follows.

ClearCollect(SplitScan,Split(BarcodeScanner1.Value,"-")) // Assume that the separator is a dash

Set the Default property of the first text input:

Last(FirstN(SplitScan,1)).Result

Set the Default property of the second text input:

 

Last(FirstN(SplitScan,2)).Result

Set the Default property of the third text input:

Last(FirstN(SplitScan,3)).Result​

When the QR code is scanned, the scanned text is split and generated into each text input box.

Hope this helps.

Sik

 

 

View solution in original post

Highlighted
Frequent Visitor

Re: how to pass the value to multiple text input controls after running codes ?

@v-siky-msft 

        I tried your code in my app , it's works fine, thanks!      

View solution in original post

6 REPLIES 6
Highlighted
Resolver I
Resolver I

Re: how to pass the value to multiple text input controls after running codes ?

Hi @wht_629 ,

 

Can you share more about your problem? A screenshot would be helpful.

 

Do you need the scanned string in the txtScannedString.text to be split further into different text input? Example

 

txtScannedString: AOOO1-12345-67890

Split String 1: AOOO1

Split String 2: 12345

Split String 3: 67890

 

If so, the RIGHT, LEFT, and MID function can solve your problem. Set the default of the SplitTextInput depending on the "split" you will apply on txtScannedString.text

 

Let me know if this helps.

 

Thanks!

Highlighted
Community Support
Community Support

Re: how to pass the value to multiple text input controls after running codes ?

Hi @wht_629 ,

 

Try to Set the OnScan property of BarcodeScanner as follows.

ClearCollect(SplitScan,Split(BarcodeScanner1.Value,"-")) // Assume that the separator is a dash

Set the Default property of the first text input:

Last(FirstN(SplitScan,1)).Result

Set the Default property of the second text input:

 

Last(FirstN(SplitScan,2)).Result

Set the Default property of the third text input:

Last(FirstN(SplitScan,3)).Result​

When the QR code is scanned, the scanned text is split and generated into each text input box.

Hope this helps.

Sik

 

 

View solution in original post

Highlighted
Frequent Visitor

Re: how to pass the value to multiple text input controls after running codes ?

 hi 

     I attached my mobile screen, I pressed button "Scan" to begin to scan the QR code, then pass the scanned value to scannedString text input.

    once scannedString has the new value, I wanted the code to split the scannedString to other text input ( I set up their display mode to view )  .

 

    as I am new to power Apps , so don't know how to access splitted values and control the logic to assign the value to other

    text inputs.

Highlighted
Resolver I
Resolver I

Re: how to pass the value to multiple text input controls after running codes ?

Hi @wht_629 ,

 

Can you elaborate further how exactly you want to split the text? And how many text inputs do you have? And what should be their value from the scannedString?

Highlighted
Community Support
Community Support

Re: how to pass the value to multiple text input controls after running codes ?

Hi @wht_629 ,

 

Have you tried my workaround?

 

You just need to save the split values into a collection, and configure the Default property of these Text Input box based on the row of split values collection.

 

Sik

Highlighted
Frequent Visitor

Re: how to pass the value to multiple text input controls after running codes ?

@v-siky-msft 

        I tried your code in my app , it's works fine, thanks!      

View solution in original post

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,158)