Forum Discussion
QuickBaseCoachD
7 years agoQrew Captain
The formula for the medical ID, but not tested, so post back if any problems, would be
var text Inital = left ([First Name],1);
var text LastThree = left([Last name],3);
var text Med = Right([medical ID]);
$Initial & $LastThree & $Med
Now, you asked if that could be the Record ID. The Te odd Id is a built in automatic field which is a number wheel which sequentially counts up as records are added.
If you want to make a field in that format to actually be the Key field to the table, then typically tha is done by having a field calculated, and then a form rule to copy that to the key field of the table. There is also an advanced technique which can be used in some circumstances to make they key field be a formula field.
Btw, I suggest that the Medical ID field be a text field as opposed to a numeric field as it�s a very large number. I will need to recheck my notes, but I think that the largest number that Quick Base can hold is 14 digits, which is the length of your field in your example. A Text field can be any length.
var text Inital = left ([First Name],1);
var text LastThree = left([Last name],3);
var text Med = Right([medical ID]);
$Initial & $LastThree & $Med
Now, you asked if that could be the Record ID. The Te odd Id is a built in automatic field which is a number wheel which sequentially counts up as records are added.
If you want to make a field in that format to actually be the Key field to the table, then typically tha is done by having a field calculated, and then a form rule to copy that to the key field of the table. There is also an advanced technique which can be used in some circumstances to make they key field be a formula field.
Btw, I suggest that the Medical ID field be a text field as opposed to a numeric field as it�s a very large number. I will need to recheck my notes, but I think that the largest number that Quick Base can hold is 14 digits, which is the length of your field in your example. A Text field can be any length.
- AlexMcClelland7 years agoQrew Trainee
I'm not sure if I entered your formula text incorrectly of if something needs to be changed about the code but I got the following error box:
Formula error -- Bad or missing arguments in function call
The types of the arguments or the number of arguments supplied do not meet the requirements of the function Right.
The function Right can be used with the followi9ng arguments:
- Right (Text t, Number n).
-Right (Text t, Text d).
You may need to do one of the following to fix the problem:
- Choose the right number and type of arguments.
- Use a type conversion function to convert the argumetns you are using to the correct type.
- Choose a different function.
Also, its just the last 4 digits of the Medicaid ID# in our internal Medical Record ID. The full Medicaid ID number is actually 12-digits long but we use the JSmi & only the last 4 digits from the actual Medicaid ID #. Thanks again! - QuickBaseCoachD7 years agoQrew CaptainMake this correction
var text Med = Right([medical ID],4); - AlexMcClelland7 years agoQrew TraineeThis worked Thanks!! & I Pm'ed you from your site about continued coaching