Forum Discussion

edcooper's avatar
edcooper
Qrew Assistant Captain
8 years ago

Text field with numbers and or letters

I have a text field called P.O.#
The reason it's a text field is that some P.O.'s we receive have a text prefix i.e. PR92828.
Some are only numbers i.e. 63636.
If I enter 63636 as the P.O. number and save it, it appears as 63,636. I do not see any setting for not adding the commas in text field that contains on numbers.
  • MCFNeil's avatar
    MCFNeil
    Qrew Captain
    you might be able to set the field properties via the API_SetFieldProperties
    https://help.quickbase.com/api-guide/index.html#setfieldproperties.html%3FTocPath%3DQuick%2520Base%2...

    number formatting is:  "&numberfmt="
    for no cammas: "0"

    URL:
    https://target_domain/db/target_dbid?a=API_SetFieldProperties&fid=7&numberfmt=0&apptoken=app_token

    If the api response says "No error" then you are good to go.  I haven't tested it. But I've forced field properties on fields that normally don't give you the option before.
  • MCFNeil's avatar
    MCFNeil
    Qrew Captain
    Another workaround option is to change the field to a numeric field. 
    Then it will give you the settings option to chose the comma usage.  change it. save it. then change the field back to text.

    If you already have data in there with letters. I'd recommend duplicating the field and testing, so you don't lose your data.

    (Again, I've never had to do it this way, but sometimes changing the field type will carry over old attributes)
  • edcooper's avatar
    edcooper
    Qrew Assistant Captain
    I will try it. Thank you. 
    Seems like this should be a standard setting for a text field since I'm sure many people deal with P.O. numbers like AT48094 .
  • edcooper's avatar
    edcooper
    Qrew Assistant Captain
    I will write a support ticket. When I get a response I'll copy you.
  • edcooper's avatar
    edcooper
    Qrew Assistant Captain
    Just as a follow up....
    I created a ticket with QB support. Explained in detail. I know it wasn't my imagination because I found other with the same experience. One that gave me the.....change to numeric then back to text....which worked.
    QB support said it should not be adding commas in a text field.
    So, I added a new TEST text field this morning to the same table where the situation occurred. 
    Lo and behold it behaved correctly. I'm writing it off to an anomaly. But as a programmer and developer for 35 years my instinct was to track down what was causing it. Glad it was resolved.

    Thank you for your help.