Discussions

 View Only
  • 1.  URL Button - Count how many times are clicked

    Posted 10-17-2019 16:29
    I have a URL button that runs an import. Every time we click this URL button, it creates/import a set of data and I'd like to keep track of the revision of the data.. Therefore, every time I click this button, it change the field within the record to "Plus 1".
    However, I'd like to have this same button to keep track of how many times it has been clicked.

    thanks,

    Erikson Tsang

    ------------------------------
    Erikson Tsang
    ------------------------------


  • 2.  RE: URL Button - Count how many times are clicked

    Posted 10-17-2019 17:57
    Therefore, every time I click this button, it change the field within the record to "Plus 1".​

    Can you clarify? It sounds like you already track it in this field. 



    ------------------------------
    Everett Patterson
    ------------------------------



  • 3.  RE: URL Button - Count how many times are clicked

    Posted 10-17-2019 18:57
    I do have a numeric field to track; however, i'm not sure how to trigger that numeric field to change from 0 to 1, when i click that URL button once.. and then, later if i click the same button again, the numeric field will change from 1 to 2 within the record

    ------------------------------
    Erikson Tsang
    ------------------------------



  • 4.  RE: URL Button - Count how many times are clicked

    Posted 10-17-2019 22:53
    Can you post your existing code to run the import?

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



  • 5.  RE: URL Button - Count how many times are clicked

    Posted 10-18-2019 15:01
    Agreed with Mark, need to see the code...

    how I would implement this is to have some JavaScript to get the current value of the field, +1 to it, and update the field as a separate call that would happen at the same time as the import.

    ------------------------------
    Ryan Stanford
    ------------------------------



  • 6.  RE: URL Button - Count how many times are clicked

    Posted 10-18-2019 15:33
    Yes, but if you just want a simple, native solution you can use numeric field + formula URL

    var number mynewvalue = [NumericTest] + 1;
    
    URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#] & "&_fid_15=" & URLEncode($mynewvalue)​


    ------------------------------
    Everett Patterson
    ------------------------------



  • 7.  RE: URL Button - Count how many times are clicked

    Posted 10-18-2019 15:44
    .... but we need to see your current code in order to help you sequence the counter formula above combined with the import and then refresh the page you are on.

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



  • 8.  RE: URL Button - Count how many times are clicked

    Posted 07-22-2020 14:30
    Hi Everett,

    Great insight - Can you expound on this a bit more. 

    My understanding is you would first need to create a numeric field which in this case would be "Numeric Test". You would then place this formula into a formula url field correct? Also would "fid_15" be the field id for "Numeric Test"?

    Lastly which field would hold the count? Would it be the url field or the numeric field? I'm guessing the numeric but not entirely sure.

    ------------------------------
    Wallace Yeboah
    ------------------------------