Skip 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.

Simple(?) counting script

Featured Replies

I have a script that finds a set of records. I want to go through that set and increment a series of counters, based on ZIP Code. I wrote a script (simplified to one ZIP only) as follows:

If ["ZIP Code = 90266"]

Set Field ["Undup Count 90266", "Undup Count 90266+1"]

Set Field ["Undup Count Non~BCHD", "Undup Count Not 90266+1"]

Go to Record/Request/Page [Exit after last, Next]

End If

The script runs, but the fields I want to increment do not return a value. The selected set of records totals 39, of which I know 2 are ZIP 90266.

I have tried putting the fields in the Body, Footer, and a Summary field, but none of that helps.

Could someone tell me what I'm doing wrong, and perhaps where to find a comprhensive article on setting up incremental counters in a script.

Thanks,

Is the Zip code field text or number? If it's text, the expression you have above in the IF won't work, because 90266 is a number.

It looks to me that your Go to Record/Request/Page step is in the wrong place. Because it's inside the If statement, it won't advance to the next record unless a match is found to that zip code. It should be after the End If step.

  • Author

Actually, ZIP Code is a calculation from a field called ZIP Code Extended. We did that because only a few persons give you the full 10 space ZIP. However the calculation returns a number result.

So I tried creating a ZIP field that was a number, and hand entered the numbers for a test set of records. So the script reads:

If ["ZIP = 90266"]

Set Field ["Undup Count 90266", "Undup Count 90266+1"]

Set Field ["Undup Count Non~BCHD", "Undup Count Not 90266+1"]

Go to Record/Request/Page [Exit after last, Next]

End If

But that does not work either.

Sorry to aks what seem obvious questins.

Have you defined the Undup Count... fields as Global Number?

Do you initialise them to 0 before the If?

Just for debugging purposes, put a Pause script step immediately after the IF step. If your script doesn't pause, then the IF condition isn't evaluating the way you think it should.

And just for clarity's sake, this is part of a Loop script, right? I'm assuming it is, and you're just showing us a part of the script.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.