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.

Count field - grateful for your advice

Featured Replies

Hi

I have a database of 10,000 records. One of the fields is 'Profession', validated against a Value List of 30 professions. I want to create a field which automatically counts up how many records there are for each profession, and displays the number on each record. So it would show Joe Bloggs as Surveyor and then say '40' if there were 39 other surveyors.

I'm a beginner at this, but should I be setting up a calculation field which uses the Count function, and if so, can anyone advise how I should define it, assuming the Profession field is called 'Profession'.

Thanks.

Philip

Create a self-relationship from Profession to Profession. Then a calculation of Count(relationship::id) will give it to you.

  • Author

Hi Queue

Thanks for the advice. I've created the self-relationship, and created a new calculation field, but I'm not sure what the (relationshiop::id) is. If I haven;t exhausted your patience, can you explain?

Thanks.

Philip

I am trying to write a script to find out whether a radio button is selected or not ex. If (radio button names=1) then ........ Is this right? I mean, what does the radio button return as a value?

Philip, relationship::id translates to the related id or serial number field (unique identifier) based on the self-relationship we've just created. When you create the calculation, enter Count(, then select the self-relationship from the menu above the field list, and the serial number field from the resulting list. Then enter the closing parenthesis.

FMFan, formatting a field as a radio button or checkbox is merely a visual aide. It doesn't change the content of the field. If you have field with "yes" and "no" radio buttons, the field contains either yes or no. So a test for the value would be If [field = "yes"] or If [field = "no"]. If you are using checkboxes or expecting that more than one radio button option will be selected, use If [PatternCount( field, "yes" )], et al.

Thanks Queue. You the man.

Did not work Queue. Actually, I have a checkbox that is either selected or not selected. I want to be able to determine whether the checkbox is selected or not by writing a script that says if check then do this else do this. Any suggestions?

What is the value for your checkbox? Use that in place of the "yes" or "no" examples above.

Do you mean the "specify field"? Well that's equal to "number". So I would say, if "table1::new="number"" then omit record? But that does not seem to work. frown.gif

If [table1::new = "number"]

Omit Record

End If

should work. Could you elaborate a little on your goal? That might help.

Queue. Somehow its not reading the radio button. I just want to read the radio button. If Radio button is "X" then omit that record. That's it.

If table1::new is your field formatted as a radio button and "X" is the option for the field's value list, then If [table1::new = "X"] should work just fine.

Put the field on your layout again, but leave it formatted as an edit box. If "X" is what you see in the field, then it is equal to "X".

Hey Queue, you're getting your workout today!! smile.gif

FMfan, do you have a radio button or checkbox - you've contradicted yourself here and it makes a difference. The 'X' in a checkbox is just FMs way of tell you it's selected - same with the dot in a radio button. That is NOT what is actually inserted into the field. You need to identify the field contents.

whether a radio button is selected or not

Regardless whether radio or checkbox however, if all you want to know is whether that field has been selected at all, just use IsEmpty() for your test.

If [not IsEmpty(Table1::New)] ... do this, else do this.

As Queue indicated, you need to 1) Look at your Value List and determine what the 'clicked' value will enter. 2) Place your field as 'edit box' field on your layout and make it about 3 rows high to see what all it contains. Why 3 rows? Because sometimes by accident it can contain more than one line and 3) be a bit more precise in your descriptions so we can assist you better.

It's just like talking to a physician. Telling him 'it hurts' doesn't give him enough to diagnose properly. If you want accurate assistance, you need to provide accurate answers. We all want to help you. So help us do that, okay? smile.gif

If you only want to know if your radio or checkbox is selected, the above calculation should work for you. If you want to Omit only if the contents equals something specific, then you need to identify your field contents.

It also appears that the field contents come from a related file/table? If so, it will only display the first matching record from the relationship if it's a regular field on your layout. You may have something else wonky. But I would bet you have a number in that 'checkbox' a one (1). And your Value List only has a 1 in it (if that field is number). That's usually how using a checkbox toggle works.

Does anyone know how to do a hover feature over a button to make the text change color when the mouse is over it? grin.gif

Thanks Moon Shadow. I will try that and get back to you.

Hi FMFan,

Check this Thread.

Click Here!

Lee

cool.gif

I am displaying data in a portal and the fields keep showing up for each record. I want the field to show up once per each category. Any solutions?

No. Mouseovers are not supported as of yet.

I stand corrected. That's cool!

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.