Hi!
I´m building an inventoryapp where im using the Bar and QRcodescanners.
I´m scanning barcode that is Serialnumber on computer, then I directly want the app to change to QR code scanner where I scan an QR code that will be the Title on the computer.
I then have a customer column where I manually write the customer.
Two choice columns where I manually choose chargingtype and Modell.
Then I press upload to sharepoint where it uploads everything.
But how can i first scan the barcode followed directly with a qr codescan to scan Title and keep doing this in a loop until i press back. I wan´t to be able to multiscan plenty of barcode+qr, barcode+qr, barcode+qr and so on.
My uploading code thus far:
ForAll(
collectMultiScan;
Patch(
'Tablets Original';
Defaults('Tablets Original');
{
'Name (Title)': ThisRecord.BarcodeInfoQR;
Serialnumber: ThisRecord.BarcodeInfo;
Customer: DataCardValue20.Text;
Chargingtype: DataCardValue21.Selected;
Modell: DataCardValue22.Selected
}
)
)
I now have two buttons where i first scan barcode and another one for qr, but they ending up in different rows in Sharepoint.
Collect(collectMultiScan; {BarcodeInfo: BS_Single_2.Value; Serialnumber: Gallery1})
Collect(collectMultiScan; {BarcodeInfoQR: BS_Single_QR_2.Value; Title2: Gallery1})
It would be awesome to just have one button to scan bar and qr multiple times until I back out.
Please help!
Solved! Go to Solution.
This is because i have supplied UK syntax and you have not converted it correctly to European sytax. For example, in the UK we use ';' a semicolon between commands and a ',' comma between properties in the commands. In Europe you use a ";" semicolon between properties and a ";;" double semicolon between commands.
it should be something like this
If(!var_scan_no;
Set(lastscanned;Patch(collectMultiScan;Defaults(collectMultiScan);{ID: CountRows(collectMultiScan) + 1;BarcodeInfo:BS_Single_2.Value}));;Set(var_scan_no;true);
Patch(collectMultiScan;{ID:lastscanned.ID};{BarcodeInfoQR:BS_Single_2.Value});;Set(var_scan_no;false));;Select(BS_Single_2)
I´m sorry for late answer.
Weird thing is that it doesnt work with your code, but with this code it works,
Set(lastscanned,Patch(collectMultiScan,Defaults(collectMultiScan),{ID: CountRows(collectMultiScan) + 1,BarcodeInfo:BS_Single_3.Value}));Set(var_scan_no,true);
Patch(collectMultiScan,{ID:lastscanned.ID},{BarcodeInfoQR:BS_Single_3.Value});Set(var_scan_no,false);Select(BS_Single_3)
But now it puts first same barcode in both Name and serialnumber column. Then when second barcode comes it creates a new row where only the name comes in both columns.
If i use your code, then it still screams on If(!var_scan_no;.
Any ideas?
hi, just add Select(BarcodeScanner1) as the last bit of code in the OnScan property. example is
Collect(col_Scan_Codes,BarcodeScanner1.Value);Select(BarcodeScanner1)
Okay, but how can I have the two scanned codes to land on the same item row in Sharepoint?
As for now it creates tow different objects on every scan. I´m using labels where the scans ends up in the app. Should I use something else like table?
try this
Create a button and change its OnSelect to: ClearCollect(col_temp,{ID:"" ,Scan1:"",Scan2:""}). This button will never be pressed, you can hide it if you want.
With your barcode scanner OnScan add:
If(!var_scan_no,
Set(lastscanned,Patch(col_temp,Defaults(col_temp),{ID: CountRows(col_temp) + 1,Scan1:BarcodeScanner1.Value,Scan2:""}));Set(var_scan_no,true),
Patch(col_temp,{ID:lastscanned.ID},{Scan2:BarcodeScanner1.Value});Set(var_scan_no,false));Select(BarcodeScanner1)
This will check if it is the first scan or the second scan, scan 1 will create a new record, scan 2 will edit the previous record. The create a patch function to submit the results to SharePoint once you have finished scanning.
I´m sorry but I really don´t understand?
Look at the attached screenshot.
Dont understand what put in. Down below you find my original setup where I have two buttons. They scan and works, but doesnt scan to the same row but different columns. Main issue.
My barcodescannersname is:
i will try do it in steps
This is because i have supplied UK syntax and you have not converted it correctly to European sytax. For example, in the UK we use ';' a semicolon between commands and a ',' comma between properties in the commands. In Europe you use a ";" semicolon between properties and a ";;" double semicolon between commands.
it should be something like this
If(!var_scan_no;
Set(lastscanned;Patch(collectMultiScan;Defaults(collectMultiScan);{ID: CountRows(collectMultiScan) + 1;BarcodeInfo:BS_Single_2.Value}));;Set(var_scan_no;true);
Patch(collectMultiScan;{ID:lastscanned.ID};{BarcodeInfoQR:BS_Single_2.Value});;Set(var_scan_no;false));;Select(BS_Single_2)
I´m sorry for late answer.
Weird thing is that it doesnt work with your code, but with this code it works,
Set(lastscanned,Patch(collectMultiScan,Defaults(collectMultiScan),{ID: CountRows(collectMultiScan) + 1,BarcodeInfo:BS_Single_3.Value}));Set(var_scan_no,true);
Patch(collectMultiScan,{ID:lastscanned.ID},{BarcodeInfoQR:BS_Single_3.Value});Set(var_scan_no,false);Select(BS_Single_3)
But now it puts first same barcode in both Name and serialnumber column. Then when second barcode comes it creates a new row where only the name comes in both columns.
If i use your code, then it still screams on If(!var_scan_no;.
Any ideas?
It works! Had to change a little bit in the code! Thank you very much @C-Papa you saved my life! 🙂
I changed language in my portal and used your code:
If(!var_scan_no,
Set(lastscanned,Patch(collectMultiScan,Defaults(collectMultiScan),{ID: CountRows(collectMultiScan) + 1,BarcodeInfo:BS_Single_3.Value}));Set(var_scan_no,true),
Patch(collectMultiScan,{ID:lastscanned.ID},{BarcodeInfoQR:BS_Single_3.Value});Set(var_scan_no,false));Select(BS_Single_3)
Take care!
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
193 | |
45 | |
45 | |
43 | |
35 |
User | Count |
---|---|
270 | |
81 | |
80 | |
73 | |
69 |