Forum Discussion

AndreonnaGarret's avatar
AndreonnaGarret
Qrew Assistant Captain
8 years ago

Auto Fill Date Field Based Off of Another Field

Hello, 

I would have three fields that I would like to work together, [Status], [Scheduled Date] and [Completion Date]. Essentially I want the [Completion Date] field to auto fill with the same date as the [Scheduled Date] field once the [Status] field is equal to "Complete". 

Any thoughts on how to make this work? I'm a little new at QuickBase. 

Thanks!

14 Replies

  • MCFNeil's avatar
    MCFNeil
    Qrew Captain
    You will need to set a "dynamic form rule" to populate that date, when your status field is changed.  

    If you are an Admin on the account and you open up one of the records
    >
    In the top right you will see "Customize This Form"
    >
    After opening up those settings, click on the "Dynamic Form Rules" tab
    >
    Create a new rule with the needed logic
    >
    Something to the affect of:

    Condition
    If [Status] is equal to "Complete"

    Action:
    Change [Completion Date] to the value in the field [Scheduled Date]
    • AndreonnaGarret's avatar
      AndreonnaGarret
      Qrew Assistant Captain
      I thought for sure this was going to work, however it just enters in todays date instead of the date from the field. 

      After conducting further research this may be because of how it is set up. I have on another table a URL button that when pressed, changes the [Status] field to complete. For some reason when this is pressed it enters todays date in the [Completion Date] field. If I manually on the record change the [Status] field to complete it works properly. 

      Any thoughts on how to fix this so the URL button will work?
    • ChrisChris's avatar
      ChrisChris
      Qrew Assistant Captain
      Can you past the button code in here? It may be coded to populate the date field.
    • AndreonnaGarret's avatar
      AndreonnaGarret
      Qrew Assistant Captain
      var text url =
        URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
          "&rid=" & [Record ID#] &
          "&apptoken=biyf682cpfpeqfbfpv8pida6k3gy" &
          "&_fid_15=Complete" &
          //"&_fid_57=true" &
          "&_fid_17=" &Now();


      If([Status]="Complete","",
      "<a class=\"Vibrant Primary\" href=\"javascript:" & "$.get('" & $url &
          "', function(){" & "location.reload();" & "});" &
          "void(0);\">Complete</a>"
      )
  • ChrisChris's avatar
    ChrisChris
    Qrew Assistant Captain

    Andreonna,

    Are you certain the two dates will always match? Is it not possible that [Completion Date] may occur sooner than or later than [Scheduled Date] ?

    • AndreonnaGarret's avatar
      AndreonnaGarret
      Qrew Assistant Captain
      The field needs to be able to be edited in the case that they are not the same. 95% of the time they will be the same date. 
    • ChrisChris's avatar
      ChrisChris
      Qrew Assistant Captain

      You would auto populate the [Completion Date] field much like Matthew said, except when [Status] = "Complete", change [Completion Date] to the current date in the form rule. You will still be able to edit the [Completion Date] field manually, the form rule allows you to populate the date field automatically upon a certain condition.

      In the form rule, you may want to check the box that says, "change occurs when condition changes from false to true". This will keep the [Complete Date] from changing to the current date every time the record is edited subsequent to its completion.

    • AndreonnaGarret's avatar
      AndreonnaGarret
      Qrew Assistant Captain
      Chris, Can you please look at my comment on Matthews post as well regarding the URL button. This seems to be causing an issue. 

      Thanks!