Skip to main content
Question

changing field types from user input

  • April 13, 2019
  • 0 replies
  • 39 views

Is there a way to change a field type based on data in another field?

My app tracks performance on service level agreements, and the metric can be either a percentage, a time in seconds or a number of incidents, depending on the contractual language of the SLA.  Currently it's a text value, but I am going to add some formulas to determine whether we failed the metric and to calculate penalty amounts and need to be able to toggle the type between "number" and "number - percentage" depending on the value in a metric data type drop down list.  Is there a way to do this?
This topic has been closed for replies.

You cannot change a field type by formula. One solution is to have it be a text field but calculate a text result which appears to be a number or a percent.

  • Quickbase Alumni
  • April 14, 2019
My Colleague is correct. field types are static unless changed in the field settings. You can only convert value types from other field using formulas: toText (Number) or ToNumber([a number stored in text field]).

  • Author
  • Quickbase Alumni
  • April 15, 2019
solution I'm going with then is to change my [standard] field to a numeric and enter everything as a decimal (boolean are 1 and 0, 99.95% is 0.9995, etc.) and using mid(totext([standard])) to grab digits at certain places and insert the "." and "%" where appropriate. 

(I am of course using a case function for boolean, integer or percentage, just working on the percentage part now)

The problem I'm running into now is that the system isn't keeping leading/trailing zeroes, so percentages that are single digit or have no value after the inserted decimal point will not show up properly.  Is there a way to tell Quickbase that I need to keep all the leading/trailing zeroes on a field?

  • Quickbase Alumni
  • April 15, 2019
Ben,
I recommend that you explore using different fields and use form rules to use the proper field based on the SLA type. Then use formulas if needed to display your results and make data entry fields non-reportable.