Forum Discussion

MaryMary's avatar
MaryMary
Qrew Cadet
9 years ago

Can I set up a formula field so that a user can overwrite the information when in edit mode?

Can I set up a formula field so that a user can overwrite the information when in edit mode? Another approach would be to set the default value for one field to equal the value of another field.  Is that possible?
  • MCFNeil's avatar
    MCFNeil
    Qrew Captain
    Yes.  A good use case for this, and the example I'm going to use, is when you have an Item price, but want to have the option to override the list price.

    [My List Price] is a field coming from a parent table, or an items table.
    [Price Override] is a field that can change the value
    [Price] will be the formula field that takes the list price, or take the override price.

    [Price] formula would be:

    If( IsNull( [Price Override] ), [My List Price], [Price Override])

    If you are using text fields, the similar, but use the sign ="" rather than the null:

    If( [My Override Text]="", [My Default Text], [My Override Text])
  • .. just a tip.  If you are checking a numeric field to be blank with IsNull, be sure to set that numeric field to not treat blank as null.  There is a field property checkbox for that.
  • Thanks.  That is the way I have been doing it.  Was just wondering if there was a way using only one field.
    • MCFNeil's avatar
      MCFNeil
      Qrew Captain
      Can you describe your set up a little more?  as far as tables and fields you are using.

      You could possibly modify the button to write the value to the field when you first load the page, but give you the option to override it in the same field.  But this depends on your set up, and where the data is coming from.
    • MaryMary's avatar
      MaryMary
      Qrew Cadet
      Here is my specific situation...
      I have a stipend field and a benefits field.  Both are currency.
      Once I enter the stipend amount, I want the benefits field to be auto-populated as 25% of the stipend.  This is our estimate.  
      Once the stipend has been processed and paid, I will know the actual benefits dollar amount.
      I would like to overwrite the auto-populated benefit amount with the exact benefits amount in the same field.
    • QuickBaseCoachD's avatar
      QuickBaseCoachD
      Qrew Captain
      This can be done with a formula which does that 25% calculation and a form rule

      When [Benefits] is blank
      Change [Benefits] to the value in the field [Stipend arstinsted]

      You will have to have the [Benefits Estimated] field on the form, even if it's in a hidden section.

      You can experiment with that rule or else a rule based on
      "when the record is saved