Forum Discussion

AmyChristensen's avatar
AmyChristensen
Qrew Member
2 years ago

Pipeline formula to extract last 5 characters of text string

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
------------------------------

4 Replies

  • MarkShnier__You's avatar
    MarkShnier__You
    Qrew #1 Challenger

    I suggest making a native Quickbase formula field. 

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



    ------------------------------
    Mark Shnier (Your Quickbase Coach)
    mark.shnier@gmail.com
    ------------------------------
    • AmyChristensen1's avatar
      AmyChristensen1
      Qrew Trainee

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



      ------------------------------
      Amy Christensen
      ------------------------------
  • DougHenning1's avatar
    DougHenning1
    Community Manager

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

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



    ------------------------------
    Doug Henning
    ------------------------------
    • AmyChristensen1's avatar
      AmyChristensen1
      Qrew Trainee

      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
      ------------------------------