Skip to main content
April 13, 2022
Question

Making barcode field blank

  • April 13, 2022
  • 12 replies
  • 1 view

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
    April 13, 2022

    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.

    April 13, 2022

    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
    April 13, 2022

    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?