Forum Discussion

EricKnudson's avatar
EricKnudson
Qrew Trainee
5 years ago

Formula to convert text line to number string

Hello All,

Looking to convert up to 60 character text fields to a number that is unique to that specific text.

Has anyone solved for this before?  Basically for each response would like a unique number or if the same response happened it could share that number also. 

Hope this makes sense.




------------------------------
letsmakeitbetter letsmakeitbetter
------------------------------
  • Hi,

    So would the number being output by this 60 character text field also be a 60 character number?

    ------------------------------
    Evan Martinez
    Community Marketing Manager
    Quick Base
    ------------------------------
    • EricKnudson's avatar
      EricKnudson
      Qrew Trainee
      It could be but not necessary.  Only thing that is important is that unique text string has a unique number.  string doesnt need to be case sensitive.

      ------------------------------
      letsmakeitbetter letsmakeitbetter
      ------------------------------
  • How many digits does the number need to be limited to?  Can it be a text string using 0-9 only?  Actual Quick Base numeric fields cannot have more than about 13 digits before they loose accuracy.

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------
    • EricKnudson's avatar
      EricKnudson
      Qrew Trainee
      Thanks for responding!  The length of the number doesn't matter to me only that it is unique to text.

      ------------------------------
      letsmakeitbetter letsmakeitbetter
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        I think this will work

        var text MyField = Upper([Text to Convert]);

        var text StepOne = SearchAndReplace($MyField,"A","1");

        var text StepTwo = SearchAndReplace($StepOne,"B","2");

        var text StepThree = SearchAndReplace($StepTwo,"C","3");


        etc

        var text StepTwentySix = SearchAndReplace($StepTwentyFive,"Z","26");

        var text StepTwentySeven = SearchAndReplace($StepTwentySix," ","27");

        $StepTwentySeven

        EDIT: This will be a formula text field type.

        ------------------------------
        Mark Shnier (YQC)
        Quick Base Solution Provider
        Your Quick Base Coach
        http://QuickBaseCoach.com
        mark.shnier@gmail.com
        ------------------------------