Discussions

 View Only
  • 1.  Pipeline formula to extract last 5 characters of text string

    Posted 03-09-2023 11:39

    Hello all,

    I have been trying to find any way to set up a pipeline that extracts the last 5 characters of a text string of varying length to copy to another field. There are some consistencies that could be used to identify the start of the string, but a formula that simply states "X characters" would be most straightforward. Is that an option in QB?

    Thanks in advance!



    ------------------------------
    Amy Christensen
    ------------------------------


  • 2.  RE: Pipeline formula to extract last 5 characters of text string

    Posted 03-09-2023 17:54

    I suggest making a native Quickbase formula field. 

    Right(Trim([my text field]),5)



    ------------------------------
    Mark Shnier (Your Quickbase Coach)
    mark.shnier@gmail.com
    ------------------------------



  • 3.  RE: Pipeline formula to extract last 5 characters of text string

    Posted 03-10-2023 11:01

    Thank you, I had been searching and never found the RIGHT function. Easy enough!



    ------------------------------
    Amy Christensen
    ------------------------------



  • 4.  RE: Pipeline formula to extract last 5 characters of text string

    Posted 03-10-2023 10:54

    In Jinja you can use [-5:] on a string to get the last 5 characters. Example:

    {{ a.field_name[-5:] }}



    ------------------------------
    Doug Henning
    ------------------------------



  • 5.  RE: Pipeline formula to extract last 5 characters of text string

    Posted 03-15-2023 12:55

    This is the solution I tried first, but without the colon - which is probably why it only returned a single character! Mark's solution was more straightforward for this use case, but I'll keep this in my hip pocket for the future. Thanks!



    ------------------------------
    Amy Christensen
    ------------------------------