Parsing Scanned Data Seguir

0
Avatar
Peter Bartsch

I would like to have an input field where I can scan a QR code and then parse the information into two separate fields.

The QR code contains a Serial Number and an Item Number delimited by a semicolon.

Any help would be greatly appreciated.

Thank you,

Peter Bartsch  

3 comentarios

0
Avatar
Peter Thane

You probably need to include a VB script routine to achieve this. 

  1. Add a Text Field off the side of the label and on the Data Source screen give this field a name. I called mine "parsetest". Give the field a default value also containing a semicolon in it. 
  2. On the Data Entry from add a Text Input item and link this to the field you just named above.
  3. Back on the Template View add on a new text field and make this a Visual Basic Script > Event Controlled Script and then press the Edit with Script Editor button
  4. The screen should open up with the OnAutoSelectedEvent enabled and in the large box in the middle give the field a default value by typing in Value = "1234" for example
  5. In the column in the left now choose the OnPostPrompt option and this time in the large box type Value = and then double click on the name you chose in 1 from the Named Data Sources in the column on the left after this type in the other commands below:

Value = Format.NamedSubStrings("parstest").Value

Value1=Instr(1,Value,";",1)

Value1 = Value1-1

Value=left(Value,Value1)

6.

 

(There probably is a neater solution how this can be achieved with VB if someone with more scripting knowledge were attempting this but I know that this works)

0
Avatar
Peter Thane

Oops added that with out finishing it.....

Click Close when done.

Note: The first line of your routine will be contain the name of the field you entered in 1 above and not "parstest"

The above will display the information before the semicolon but for the data after it

  1. Copy and Paste the VB Script field you  just created
  2. Go into the Properties and Edit the script to adjust the code to the following

Value = Format.NamedSubStrings("parstest").Value

Value1 = Instr(1,Value,";",1)

Value2 = Len(Value)

Value1 = Value2-Value1

Value=Right(Value,Value1)

Again click Close when done

0
Avatar
Peter Bartsch

Hi Peter That worked great, I now have two fields with the correct parsed info. One with Serial Number and the other with the Item ID. How would I set my Query Prompt to use the value in the ItemID field?

Thank you so much for your help.

Peter

Iniciar sesión para dejar un comentario.