Quickbase Discussions

 View Only
  • 1.  Formula to display one part of text field

    Posted 05-18-2022 09:14
    Hello! I'm looking for help with the proper formula syntax to grab a string of numbers from a text field. The string I want will also be after the word "Code" and before the word "Order".

    Code: 123456789
    Order: XXXXXXXX

    Thanks!

    ------------------------------
    Raymond Sakar
    ------------------------------


  • 2.  RE: Formula to display one part of text field

    Posted 05-18-2022 09:25
    There is more than one way to do this, and detecting a line feed can be tricky, but try this

    Trim(Right(Left([my Code Order field], "\n"), " "))

    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------



  • 3.  RE: Formula to display one part of text field

    Posted 05-18-2022 09:44
    Thanks, Mark. That formula output the Order #, not the Code. I've tried several variations and can't seem to get the Code.​ I either get the Order, the word "Code" or the word "Order"

    ------------------------------
    Raymond Sakar
    ------------------------------



  • 4.  RE: Formula to display one part of text field

    Posted 05-18-2022 13:51
    OK, Plan B

    var text ReplaceCode = SearchAndReplace([Code Order], "Code:", "|");
    var text ReplaceOrder = SearchAndReplace($ReplaceCode, "Order:", "|");

    Trim(Part($ReplaceOrder,2, "|"))

    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------