Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Counting the number of flagged Records

Featured Replies

I have a list of records in a table (CONDITIONS) shown on a list view. One of the fields is a checkbox when checked sets a value "Yes" to the field.

I needed a calculation that shows the number of records flagged.

 

What I tried:

 

  1. List of Records shown are based on a TO (Layout_Conditions)
  2. A field called "Flag" in each record is displayed as a checkbox to set a value "Yes"
  3. Created another TO based on CONDITIONS base table and named it "showCount_ofChecked"
  4. Created a global field gCheckedState and set it to "Yes"
  5. Created a self relationship between Layout_Conditions::gCheckedState and showCount_ofChecked::Flag
  6. Created a calculation field cCount_ofCheckedRecords(global, calculation, NumberResult) to count(showCount_ofChecked::Flag) from the context of Layout_Contacts

 

But it does not work. cCount_ofCheckedRecords is always 1 whether one or several records are flagged.

 

Any suggestions how to fix this. Thanks

Solved by comment

Go to solution
  • Solution

Why don't you simply use a summary field, defined as Count of [Flag]? This will work for both the found set and - if you prefer - across a relationship.

 

 

---

BTW, a smarter way to use a flag field is to make it a Number field and attach a value list of "1" instead of "Yes".

  • Author

Why don't you simply use a summary field, defined as Count of [Flag]? This will work for both the found set and - if you prefer - across a relationship.

 

 

---

BTW, a smarter way to use a flag field is to make it a Number field and attach a value list of "1" instead of "Yes".

 

When I used the Count of [Flag] summary field, I got the magic number 17 all the time ?! Couldn't figure out where that came from.

 

Thanks for pointing out to use number 1 instead of "Yes". Flipping the Flag is much easier now.

When I used the Count of [Flag] summary field, I got the magic number 17 all the time ?! Couldn't figure out where that came from.

 

Depends on where you used it (i.e. in which context).

 

Do you want to count the number of flagged records in the current found set, or the number of flagged records in the entire table?

  • Author

Yes ! Thank you. It reports the correct result in the current found set. That is when I do a find in List view and flag records, it works fine.

But what I need is the number of flagged records in the entire table.

 

I tried Running count, it --kinda-- works. I use a script attached to an invisible rectangle of height 44pixels to flip the flag (for use on an ipad)

The dataviewer shows the correct count when clicking and holding the mouse but the result reverts to 1 on releasing the mouse ??

But what I need is the number of flagged records in the entire table.

 

Then you'll need to count across a relationship. There's probably a simpler method to arrange this than what you have described in your opening post, but I'd like to stick with for the moment because AFAICT it should work - see the attached file.

 

CountStatus.fp7.zip

 

If it doesn't, you must either have another thing going on in there or I have misread your description (it is kind of difficult to read).

  • Author

Thank you so much. When I tried using the summary field using the self relationship it works.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.