Skip to main content
Question

Count characters in a string, find string location in a string, etc?

  • January 18, 2019
  • 0 replies
  • 178 views

Is there still no way to count occurrences of a string within a string? Or to find the index of the first occurrence of a string within a string? The reason I ask is because this seems like a simple operation that should be included in the long list of functions available in Quickbase formulas. Also, since Quickbase has a "Mid" function why wouldn't they have a way to find the index of string? As I'm sure Dan would point out, those two are used very often together in programming languages. In fact, every time I've ever used Mid to extract a bit of string I've needed to dynamically break it up based on the index of another string.

Anyway, if someone could point me to a page to post this where it could be helpful for future Quickbase implementations let me know.  
This topic has been closed for replies.

Forum|alt.badge.img+17
  • Community Moderator
  • January 18, 2019
Hi Lane,

Currently we do not have a function built into our formulas to find the index of a string. There are some work arounds using the Left() and Right() functions or Part() off of a recognize-able pattern that can chain together but they can get lengthy. I think a function to help count the occurrence of a string would make a great suggestion and our product development team uses our User Voice page to track user support for future features and enhancements. The Quick Base User voice can most easily be accessed from the My Apps page in Quick Base by clicking on the orange Feedback tab that appears on the right of the page or at http://quickbase.uservoice.com by signing in with your Quick Base credentials. 

I usually suggest if someone from the Community adds a User Voice request that they post a link to it here. That way any other Community users that come across this post will be able to add their vote as well and show support. Thank you very much for your time today Lane. 

  • Registered
  • January 18, 2019
You can always pass the string via URL parameter to a custom code page and do the string coding there via JavaScript or whatever. You can then display the value on the code page if you are just needing to know the number. There are additional options for putting that value back into a record field but it is more lengthy. 

  • Author
  • Registered
  • January 18, 2019
If everyone reading this could support the following feedback post with votes and comments that would be great: https://quickbase.uservoice.com/forums/111823-quick-base-product-feedback/suggestions/36563971-inclu...




  • Registered
  • January 23, 2019
You can perform any manner of text manipulation you want using script. Here is a demo that expands TLAs (Three Letter Acronyms) using one Rich Text Field:






Try it yourself:

TLA Expander ~ Add New Record
https://haversineconsulting.quickbase.com/db/bpb2mbnva?a=nwr

Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=722

Notes:

(1) Any manner of text manipulation can be performed with script. I just happened to have this demo in the pipeline based on some other client work.

(2) The script as written performs these substations:
    AMA:   'Ask Me Anything',
    BAE:   'Before Anyone Else',
    BFF:   'Best Friends Forever',
    BTW:   'By The Way',
    DM:    'Direct Message',
    FOMO:  'Fear Of Missing Out',
    FTW:   'For The Win',
    HW:    'Homework',
    ICYMI: 'In Case You Missed It',
    IMO:   'In My Opinion',
    IMHO:  'In My Humble Opinion',
    IRL:   'In Real Life',
    JIC:   'Just In Case',
    LMK:   'Let Me Know',
    MC:    'Man Crush',
    MT:    'Modified Tweet',
    NSFW:  'Not Safe For Work',
    NSFS:  'Not Safe For School',
    OMG:   'Oh My God',
    OOTD:  'Outfit Of The Day',
    OTT:   'Over The Top',
    RT:    'Retweet',
    SMH:   'Shaking My Head',
    TBH:   'To Be Honest',
    YOLO:  'You Only live Once',
    YSK:   'You Should Know'



Looks like some relevant functions have been added to the February 2019 release.

https://quickbase.uservoice.com/forums/111823-quick-base-product-feedback/suggestions/36563971-inclu...

Community forum post to UV suggestion to in production in about a month - that's gotta be the fastest I've ever seen. Lane, thanks again for driving this development.