Does Quickbase have a replace function?

  • 0
  • 1
  • Question
  • Updated 2 months ago
  • Answered
In JavaScript I would do something like 

var test = "I Hate Spaces";
var example = test.replace(" ", "_");

Then I could get the display "I_Hate_Spaces". Is there something similar I can do in Quickbase to replace characters in strings conditionally? I would like to be able to have it be a separate field. So then someone could then input, say a project name, then the other field would mimic the input but remove the spaces and replace them with underscores.
Photo of Jordan

Jordan

  • 1,644 Points 1k badge 2x thumb

Posted 2 years ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,558 Points 50k badge 2x thumb
There is no replace function.

But you can do this.

var text String = [My Field];
var text Delimiters = " !@#$%^&*";

List("",
Part($String,1,$Delimiters),
Part($String,2,$Delimiters),
Part($String,3,$Delimiters),
Part($String,4,$Delimiters),
Part($String,5,$Delimiters),
Part($String,6,$Delimiters),
Part($String,7,$Delimiters),
Part($String,8,$Delimiters),
Part($String,9,$Delimiters))
Photo of Jordan

Jordan

  • 1,644 Points 1k badge 2x thumb
So this will remove the characters " !@#$%^&*" from the string?
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,558 Points 50k badge 2x thumb
yes, includes the space character which is the first in this list.
Photo of Jordan

Jordan

  • 1,644 Points 1k badge 2x thumb
Mhmm this half solves the problem. I saw your post from the knowledge base early about being able to link to documents locally. I created a URL formula button based on fields in the form to be able to pull up client folders without having to navigate the server. The only time it is not working is when there are slight differences in naming conventions, such as people accidentally adding extra spaces. I was looking into replacing spaces with underscores to help reduce with inconsistency.
Photo of Michael Barrow

Michael Barrow

  • 2,216 Points 2k badge 2x thumb
I am also looking for a better way to do Replace in QuickBase, as I am coming from a Microsoft Access/VBA background and have a very robust, easy-to-use function in Access to do this, including a boolean option for case sensitivity. I had just posted a support ticket the other day about this, and I was asking if it was possible to rewrite my Access function in Javascript and be able to access that custom function in my QB formulas. They told me to set up a code page to do this and reference it in my formulas. How would I go about doing this?
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,074 Points 20k badge 2x thumb
Photo of Michael Barrow

Michael Barrow

  • 2,216 Points 2k badge 2x thumb
Thanks. What do I need to know about IOL to make this work?
Photo of Chris Pliakas

Chris Pliakas

  • 140 Points 100 badge 2x thumb
Quick Base now has a SearchAndReplace function as of the February 2019 release. See the "Formula function enhancements" section of https://help.quickbase.com/release-notes/february-2019-release-notes.html for more details.