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.

Using the "If" in a Calculation

Featured Replies

Hello Everyone:

I have a little experience in scripting, but I am not to good at calculations, and what functions to use. Here's my problem:

Basically, I am trying to set a field to a certain date based on a radio button that is clicked.

I have a value list field with 7 values in it. They are:

2 Month Contact

3 Month Contact

4 Month Contact

5 Month Contact

6 Month Contact

9 Month Contact

12 Month Contact

Then I have a date field called Projected Contact Date.

If the 2 Month Contact button is clicked today, I want the Projected Contact Date field to read March 25, 2002. I also would like the same action to happen if the other radio buttons are clicked (except the date would read May 25, 2002 and so on)

I tried to make the Projected Contact Date field a calculation field, but I have no experience here. And I know this forum is very helpful. At first I made a script that had a group of If statements to fill the field, and it worked fine but I had to have an extra button to activate the script. If someone could help me with the calculation for the field, that would be very helpful.

Thanks all for helping if you can!!

If there are any questions, please ask and I will post promtly.

  • Author

Oh, yeah.

And to simplify it a little, I would only like to have 1 month equal 30 days, as to aviod pesky months like February.

Assume you have a field called "last_app" which is the date from which the next appointment is made. You have a field "next_app_period" which has the value list result.

Create a calculation field called "next_app_period_num" which converts the text to a number of months:

Case(next_app_period = "2 Month",2, next_app_period = "3 Month", 3, next_app_period = "4 Month",4,next_app_period = "5 Month",5,next_app_period = "6 Month",6,next_app_period = "9 Month",9,next_app_period = "12 Month",12,0)

Now create a calculation field "Projected Contact Date":

Date(Month(last_app)+next_app_period_num,Day(last_app),Year(last_app))

This will give you the date for the next appointment.

Hope this helps.

Garry

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.