Hi,
I am using a barcode scanner to read an asset and display its details. This part is working fine but I want to clear the existing entry in the barcode field for subsequent barcode scans.
How can I make it work?
Thanks
a!barcodeField( label: "", labelPosition: "ABOVE", instructions: "Scan the QR Code of the Asset", acceptedTypes: "QRCODE", value: local!asset.partId, saveInto: local!asset.partId, refreshAfter: "KEYPRESS", validations: {} ),
Discussion posts and replies are publicly visible
The barcode field will display the current value of the 'value' field which means if you leave the 'value' field blank then after your scan the field will blank itself out. Within the saveInto field you can use save!value to save that value into different variables or lists.
Hi Danny Verb,
I want to clear the asset no. after pulling the summary view of the asset. When I try doing what you suggested, it clears the value before the view pulls up. How to resolve that?
If you do
a!barcodeField( label: "", labelPosition: "ABOVE", instructions: "Scan the QR Code of the Asset", acceptedTypes: "QRCODE", saveInto: local!asset.partId, refreshAfter: "KEYPRESS", validations: {} ),
In the interface designer local variables pane, does 'local!asset' contain a value when you type something in?
It contains the part Id. I tried your way and it blanks out the field while keeping the view which is good but the when I try to scan another asset, it doesn't take the value.
It's functional on a mobile and PC.
But I am using a barcode scanner to test it and it's not clearing the field without touching the screen which is not what the user wants. Also, it keeps on populating the barcode field with subsequent assets' partIds.
As far as I know, barcode scanner act like a keyboard. Can you configure it to send the enter-key after the code?
Hi Stefan,
Yes, It works like a keyboard. Will check how to configure the enter-key and let you know how it works.
You can try something clever like having a dummy variable, local!barcodeValue, that you use in the value and saveInto fields.
saveInto: { local!barcodeValue, a!save(local!part.Id, local!barcodeValue), a!save(local!barcodeValue, null) }
Thank you Danny Verb. Works perfectly for Appian mobile app.
The issue I am having now is keeping the focus on the barcode field after a scan. Once I do a scan , the barcode field loses its focus and I have to put the cursor back to the field to get the value. Any way to fix this issue?
There is no way to directly control on focus. This behavior is completely defined by the internal implementation in the mobile app.
Ok.
Thanks Stefan.