Forum Discussion

JordanBeatty1's avatar
JordanBeatty1
Qrew Captain
7 years ago

Does Quickbase have a replace function?

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.

8 Replies

  • 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))
  • 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.
  • 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?