Discussions

Expand all | Collapse all

How can I create a formula to count the number of times a field has been modified?

  • 1.  How can I create a formula to count the number of times a field has been modified?

    Posted 10-12-2016 18:21

    I have a multiple choice field, [ISR Calling Status], that logs the entries. I want to create a formula field that counts the number of times that field has been modified (timestamped). Is there a formula that I can write for this? Can't seem to find any suggestions.

    Thanks much!



  • 2.  RE: How can I create a formula to count the number of times a field has been modified?

    Posted 10-12-2016 18:39
    Try this

    var text value = [My text field which is logging the changes];

    Count(
    Part($value,1,"]"),
    Part($value,2,"]"),
    Part($value,3,"]"),
    Part($value,4,"]"),
    Part($value,5,"]"),
    Part($value,6,"]"),
    Part($value,7,"]"),
    Part($value,8,"]"),
    Part($value,9,"]"),
    Part($value,10,"]"),
    Part($value,11,"]"),
    Part($value,12,"]"),
    Part($value,13,"]"),
    Part($value,14,"]"),
    Part($value,15,"]"),
    Part($value,16,"]"),
    Part($value,17,"]"),
    Part($value,18,"]"),
    Part($value,19,"]"),
    Part($value,20,"]")
    )


  • 3.  RE: How can I create a formula to count the number of times a field has been modified?

    Silver
    Contributor
    Posted 06-28-2019 10:58
    This was hugely helpful; my only comment (for others who see this) is that if I leave in the first Part($value,1,"]"), I get an extra-count; so I commented that line out to get an accurate count.  I also switched the ] to a [ because I found that in some cases the logging field had copied the original Note entry again; but without the first/opening [, so by looking for that I got a more accurate count.  This might just happen to apply in my case.


  • 4.  RE: How can I create a formula to count the number of times a field has been modified?

    Posted 10-12-2016 18:50
    hmmm, tried that and it's returning a Syntax error (Possible culprits are a mismatched set of parentheses, missing quotes, or an extra bracket.) I can't see anything missing off-hand.


  • 5.  RE: How can I create a formula to count the number of times a field has been modified?

    Posted 10-12-2016 18:56
    I corrected the formula


  • 6.  RE: How can I create a formula to count the number of times a field has been modified?

    Posted 10-12-2016 18:58
    Mark...you ARE THE MAN! Worked like a charm! Thanks so much!!!


  • 7.  RE: How can I create a formula to count the number of times a field has been modified?

    Posted 08-08-2017 13:38
    Mark, is there a way to do this for a file field? I would like to count the number of revisions that have been uploaded to a file field, in order to use that revision count number for another formula. 


  • 8.  RE: How can I create a formula to count the number of times a field has been modified?

    Posted 08-08-2017 13:54
    Figured out my own answer.  What I did was create a new text field title [PDF Revision History] which is logged.  I then created a form rule that read as follows:

    When the record is saved and [File] has been changed
    Change [PDF Revision History] to the value in [File].

    Note: Thanks again Mark! I found this formula from a question you answered previously in:
    https://community.quickbase.com/quickbase/topics/how-to-track-revisions-to-a-pdf-file">https://community.quickbase.com/quickbase/topics/how-to-track-revisions-to-a-pdf-file">https://community.quickbase.com/quickbase/topics/how-to-track-revisions-to-a-pdf-file

    I then created a new field with the forumula you had listed above and modified it:

    Count(
    Part($value,2,"]"),
    Part($value,3,"]"),
    Part($value,4,"]"),
    Part($value,5,"]"),
    ""

    This counts the number of times the [PDF Revision History] field has been modified which directly correlates to my [File] field.