Skip to main content
Known Participant
Apr 13, 2022 7:20 PM UTC
Question

Making barcode field blank

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: {}
      ),

    12 replies

    danny.verb
    Employee
    Apr 13, 2022 7:32 PM UTC

    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.

    Known Participant
    Apr 13, 2022 7:57 PM UTC

    Hi [mention:cd62cf79924f483cb1bf072c9026a3ec:e9ed411860ed4f2ba0265705b8793d05],

    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? 

    Thanks

    danny.verb
    Employee
    Apr 13, 2022 8:28 PM UTC

    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?