Forum Discussion

TylerMaskiewic1's avatar
TylerMaskiewic1
Qrew Member
4 years ago

Convert Multi-line Text to multiselect text using line breaks as delimiters

Hello!

I am trying to convert a multiline text field to a multiselect txt by using a formula multiselect text field. 

I tried:

Split([Rack Barcodes],"\n")

And I also tried:

Split(searchandreplace([Rack Barcodes],"\n",";"))

but it seems that neither searchandreplace() nor split() are able to find a "\n" newline in the text. Any help appreciated!

------------------------------
Tyler M
------------------------------

3 Replies

  • I tried your exact setup there with Split([Field],"\n") and that worked as expected.  I did that on Windows in Chrome and on Mac with Safari and both instances worked.  In both instances I typed directly into the multi-line text field and the split resolved after I saved the record.  Are you copying a block of text from some other application that could be using a different encoding for line feeds such as "\r"?

    ------------------------------
    Nathan Hawe
    ------------------------------
    • TylerMaskiewic1's avatar
      TylerMaskiewic1
      Qrew Member

      Nathan,

      Thanks for the help. Looks like you are correct that it resolves after saving (I honestly hadn't saved yet) as I was hoping to have it work before saving to populate another field based on a dynamic form rule. 

      Use case for me is a person scanning a paragraph of barcodes (covid samples) very quickly without having to use any key presses (our barcode scanners return the barcode and "enter" creating a new line like this:

      "72860402
      72860454
      72860498"

      Its pretty clunky but then a formula multi-select text field reads those and converts to multiselect, and then that formula multiselect is copied through dynamic form rules to a regular multi-select text field who's list is option list is based on a field of all the valid barcodes. This ensures the barcodes are all valid before the form is saved, and allows the user to see all the barcodes that have been "selected" without having to use a regular multi-select text field and fill the search bar with the scan, then check box, then clear search bar and rescan etc. Sounds like a small difference, but when we get into hundreds and thousands of scans, its a nth order speed difference.




      ------------------------------
      Tyler Maskiewicz
      ------------------------------
      • NathanHawe's avatar
        NathanHawe
        Qrew Cadet
        That's a pretty cool solution, actually.  We've used direct barcode reading into text boxes to populate fields before but that's a clever use of the multi-select field and form rules for validation.  It might be clunky but it does work.

        ------------------------------
        Nathan Hawe
        ------------------------------