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

  • 0
  • 3
  • Question
  • Updated 2 months ago
  • Answered

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!

Photo of Dawn

Dawn

  • 40 Points

Posted 3 years ago

  • 0
  • 3
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,"]")
)
Photo of QuickBasePros (Laura Thacker)

QuickBasePros (Laura Thacker), Champion

  • 6,396 Points 5k badge 2x thumb
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.
Photo of Dawn

Dawn

  • 40 Points
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.
I corrected the formula
Photo of Dawn

Dawn

  • 40 Points
Mark...you ARE THE MAN! Worked like a charm! Thanks so much!!!
Photo of PAUL

PAUL

  • 112 Points 100 badge 2x thumb
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. 
(Edited)
Photo of PAUL

PAUL

  • 112 Points 100 badge 2x thumb
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

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.
(Edited)