Discussions

Expand all | Collapse all

Date stamp formula for checkbox

  • 1.  Date stamp formula for checkbox

    Posted 04-24-2017 12:59
    Hello.

    I have a quick question regarding date stamps.

    I have two check-boxes on my form: import and export. For both, I hope to create a formula date stamp field to see when users ticked these boxes.

    We have a few older records to see when they were imported and exported. When they built this application, they did not anticipate the importance of these check-boxes.

    Is this at all possible? 

    Thank you very much for all of your help!


  • 2.  RE: Date stamp formula for checkbox

    Posted 04-24-2017 13:08
    if the data entry is being dome via the form and never by grid edit, then you can create two fields to hold the date the checkboxes were checked.

    Use a form rule such as

    CONDITIONS:
    when multiple conditions are true.
    checkbox 1 is checked
    date checkbox 1 checked is blank.

    ACTION

    change date checkbox 1 checked to the current date.

    Be sure to uncheck the box at the bottom of the form rule so it fires all the time.

    You will need to have two Form rules, one for each checkbox.


  • 3.  RE: Date stamp formula for checkbox

    Posted 04-25-2017 03:06
    Another option if you aren't going to be editing individual records on the form, is to make a formula-url field that performs an API_EditRecord function to check the box, timestamp, and even add who clicked it (if desired).

    These buttons can be used in reports, or on the form.


  • 4.  RE: Date stamp formula for checkbox

    Posted 08-20-2017 01:34
     Simple and very useful.  Do you have an example on this? 


  • 5.  RE: Date stamp formula for checkbox

    Posted 04-09-2019 00:08
    It's been a while, but Matthew can you point me in the direction of how to do this?


  • 6.  RE: Date stamp formula for checkbox

    Posted 04-09-2019 01:24
    I'm not sure if Matthew is still active on the forum.

    Here is some code to updates some fields ona record and refersh

    var date TodaysDate = Today();

    var text Update = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
    & "&apptoken=xxxxxxxxx" // you will need to decide if you want to require app tokens or just disable in App properties
     & "&_fid_100=" & $TodaysDate // put the date into fid 101
     & "&_fid_101=" & totext(User()) put who clicked into fid 102
    & "&_fid_102=1" ; set a checkbox to be true

    // then put in this code to execute the formula variable called URL and refresh the page

    var text URL = 
    "javascript:" &
    "$.get('" & 
    $Update & 
    "',function(){" &
    "location.reload(true);" &
    "});" 
    & "void(0);";



  • 7.  RE: Date stamp formula for checkbox

    Posted 04-09-2019 04:14
    Thank You! Sorry - I'm new to formula url's. Where would I enter the specific fields i want to edit/update? Just in the fid_100,101,102, etc.? Also is there any other identifier's that i would need to fill?


  • 8.  RE: Date stamp formula for checkbox

    Posted 04-09-2019 04:25
    Are there edits needed? It's giving me an expecting error.

    var date TodaysDate = Today();

    var text Update = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
    & "&apptoken=dhxpiidu5cj4edz3d8kvbn2cium"
     & "&_fid_1469=" & $TodaysDate 
     & "&_fid_1468=" & totext(User()) 
    & "&_fid_805=1" ;


    var text URL = 
    "javascript:" &
    "$.get('" & 
    $Update & 
    "',function(){" &
    "location.reload(true);" &
    "});" 
    & "void(0);";


  • 9.  RE: Date stamp formula for checkbox

    Posted 04-09-2019 10:53
    Please post the complete error message text when you save the formula.


  • 10.  RE: Date stamp formula for checkbox

    Posted 04-09-2019 10:55
    This might be the problem in the first line.

    var text TodaysDate = ToText(Today());


  • 11.  RE: Date stamp formula for checkbox

    Posted 10-10-2019 10:57
    I am also trying to accomplish this. I tried the formula listed above and get the following error. Formulas are my weakness.

    A formula cannot end with an assignment to a variable declaration.


    var text TodaysDate = ToText(Today());

    var text Update = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
    & "&apptoken=dhxpiidu5cj4edz3d8kvbn2cium"
     & "&_fid_1469=" & $TodaysDate
     & "&_fid_1468=" & totext(User())
    & "&_fid_805=1" ;


    var text URL =
    "javascript:" &
    "$.get('" &
    $Update &
    "',function(){" &
    "location.reload(true);" &
    "});"
    & "void(0);";  


    ------------------------------
    Hillary Hillary
    ------------------------------



  • 12.  RE: Date stamp formula for checkbox

    Posted 10-10-2019 12:08
    The last part with the JavaScript to run the update and refresh is not supposed to be a formula variable. Formula variables are intermediate placeholders to simply formula. 


    var text TodaysDate = ToText(Today());

    var text Update = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
    & "&apptoken=dhxpiidu5cj4edz3d8kvbn2cium"
     & "&_fid_1469=" & $TodaysDate
     & "&_fid_1468=" & totext(User())
    & "&_fid_805=1" ;



    "javascript:" &
    "$.get('" &
    $Update &
    "',function(){" &
    "location.reload(true);" &
    "});"
    & "void(0);"

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    markshnier2@gmail.com
    ------------------------------



  • 13.  RE: Date stamp formula for checkbox

    Posted 09-24-2020 14:08
    Hi,

    I'm trying to do the same and I'm using the formula recommended since for some reason even being admin on my app I'm not able to configure the ACTION editing related records.

    I'm not really experienced on URL formulas, and I'm not receiving any error on the formula, but the date stamp is not working as I was expecting.  I would appreciate additional information on how I can make it work.


    Thanks in advance

    Regards
    Mariana Ayala

    ------------------------------
    Mariana Alejandra Ayala
    ------------------------------



  • 14.  RE: Date stamp formula for checkbox

    Posted 09-24-2020 14:44
    Can you post your formula code?

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 15.  RE: Date stamp formula for checkbox

    Posted 09-24-2020 15:39
    Here is the formula

    var text TodaysDate = ToText(Today());

    var text Update = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
    & "&apptoken=dhxpiidu5cj4edz3d8kvbn2cium"
    & "&_fid_1469=" & $TodaysDate
    & "&_fid_1468=" & ToText(User())
    & "&_fid_805=1" ;



    "javascript:" &
    "$.get('" &
    $Update &
    "',function(){" &
    "location.reload(true);" &
    "});"
    & "void(0);"

    I'm not sure if the name or features of the field could be the issue. The formula seems to be right. Not error message.

    ------------------------------
    Mariana Alejandra Ayala
    ------------------------------



  • 16.  RE: Date stamp formula for checkbox

    Posted 09-24-2020 21:54
    When you use that Javascript syntax it hides any error message. 

    Comment out the bottom javascript lines and just do this to help us debug.


    var text Update = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
    & "&apptoken=dhxpiidu5cj4edz3d8kvbn2cium"
    & "&_fid_1469=" & $TodaysDate
    & "&_fid_1468=" & ToText(User())
    & "&_fid_805=1" ;

    $Update


    Then post back with the response from the button.

    It will either be an error message or a success message. 


    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 17.  RE: Date stamp formula for checkbox

    Posted 30 days ago
    Hi Mark,

    I'm still struggling with the formula, the variable in yellow what highlighted like this on the formula section


    Thank you

    Regards


    ------------------------------
    Mariana Alejandra Ayala
    ------------------------------



  • 18.  RE: Date stamp formula for checkbox

    Posted 30 days ago
    Please make a new field with this code

    var text Update = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
    & "&apptoken=dhxpiidu5cj4edz3d8kvbn2cium"
    & "&_fid_1469=" & $TodaysDate
    & "&_fid_1468=" & ToText(User())
    & "&_fid_805=1" ;

    $Update


    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 19.  RE: Date stamp formula for checkbox

    Posted 30 days ago
    Mark,

    Is giving me the next error:

    The variable  $TodaysDate is not declared.

    Regards


    ------------------------------
    Mariana Alejandra Ayala
    ------------------------------



  • 20.  RE: Date stamp formula for checkbox

    Posted 30 days ago
    OK, use this formula and let me know what it does

    var text TodaysDate = ToText(Today());

    var text Update = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
    & "&apptoken=dhxpiidu5cj4edz3d8kvbn2cium"
    & "&_fid_1469=" & $TodaysDate
    & "&_fid_1468=" & ToText(User())
    & "&_fid_805=1" ;

    $Update


    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 21.  RE: Date stamp formula for checkbox

    Posted 30 days ago
    Now the formula seems to be right, but I don't have the time stamp on the field 

    Do I need to link in some way the "Time Capitalized" (checkbox field) to the "Time" (URL formula field)

    Sorry I'm not familiar at all about URL formulas.

    Thanks


    ------------------------------
    Mariana Alejandra Ayala
    ------------------------------



  • 22.  RE: Date stamp formula for checkbox

    Posted 30 days ago
    Are you saying that button now works?  What happens when you click the link?  Also are you trying to populate a field with just the date or the current date and time?

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 23.  RE: Date stamp formula for checkbox

    Posted 27 days ago
    Hi Mark,

    I wasn't really expecting a link (but send an error if I click on it). What I'm trying to achieve and maybe I explained myself wrong was to collect a date stamp on the URL field when the user make the checkbox on the "Time Capitalized" field while he is using a report. Is this what you were helping me to do?

    ------------------------------
    Mariana Alejandra Ayala
    ------------------------------



  • 24.  RE: Date stamp formula for checkbox

    Posted 27 days ago
    Are you saying that you simply want to record the date/time that a user checks a checkbox?  If that is the situation I suggest that you post a brand new question explaining your use case from the beginning and I will watch for it.

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------