Search code examples
scriptingfilemaker

parse data from one field into others in filemaker


I am working with filemaker pro and I am looking to get some text parsed between multiple fields.

I have a barcode scanner that is set to keyboard mode, so it essentially types very fast. I what to be able to scan a barcode into a dedicated "barcode parser" field and have a script parse that text into the "correct" field. eg. the data on the barcode is "XCX0001-user", so I would scan the barcode into the parser field then have a separate field named "user" be populated with "XCX0001".

I am not looking for a full script, just some ideas on which functions would work best. Thanks!


Solution

  • You could go with a dedicated calculation field in your table that automatically parses the user from the input field, or a script if you so choose. Functions you could use could be:

    Position(text;searchString;start;occurrence), which tells you where in a text a certain string occurs,

    Length(field), which gives you the length in characters,

    Middle(text;start;numberOfCharacters), which allows you to extract part of a string based on position and so on.

    Check out other Text functions from the function list as there are many that can parse text.