Follow

Getting Started with the Calculation Field

The Basics of the Calculation Field

Often times the most difficult thing about learning new software is memorizing (often times, wrapping your brain around) the vast array of terms, symbols, navigations, icons and user interfaces. In this series, our purpose is to familiarize you with the Calculation field, enough so that could be successful with setting up basic calculations within your Forms. For those of you who generally understand scripting languages, performing more advanced calculations will probably come easier. For those of you who hear the word “javascript” and cringe… its okay, performing basic calculations in our calculation tool does not require any previous programing skills.

Terms

There are a few things that are necessary to explain before we get into writing some basic calculations. Lets nail down a few terms.

  • Field - A Field is generally defined as an area where a question is asked and an answer is requested (can also be required) from the person filling out the form. In FastField we have 26 different field types where you can use questions combined with the correct field type to gather specific and relevant data. Fields are designed to make collecting data quicker, easier and more efficient. For example: Think of a paper form where the date needs to be filled out on the top right hand corner. How are you supposed to format the date? Do I separate the day month and year with slashes, dots or commas? Do I include the full four digit year or just two digits? What if the person is from a different country and they use different formatting? What if the person has sloppy hand writing or messed up and it is no longer legible? Or better yet, what if they don't fill it out at all - Now think of a digital form, where you can simply select the date from a calendar. It automatically populates the date with the correct formatting. I think we would all agree that this is a much simpler, quicker way of collecting relevant and accurate data.

    Note: You can find a list of all of the Fields with descriptions here: https://mergemobile.zendesk.com/hc/en-us/articles/202221843-Field-Type-Overview

  • Field key - A Field key is a unique identification number for a field in your form. When you add a Text field to your form for the first time you will see in that fields settings that there is a little “Field Key” box, with a word “alpha_number” The “alpha” is describing what type of field it is, and the “_number” is associated to the order in which the field was added to your form. Feel free to change these field keys to whatever you would like, you just have to make sure that the key (combination of letters, numbers and symbols) is unique from every other field in the form you are working on. When calculating fields you will never refer to a field with the field label; You will always be calculating with the field key.

          Note: There are a few rules for making fieldkeys. There cannot be any spaces in your key, and it has to be a combination of at least one number, and one letter.

  • Score - The term “Score” will generally only come into play when calculating selections within a List Field (list, options list, global list, lookup list). You can apply a numeric value to a selection item within your List so that when the user makes that selection, it can be calculated with another field.

  • Data - Refers to the input of numbers, letters, words, and symbols as the “Answer” to a specific Field by a user. “Data” can be a general term for a grouping of answers, or it can refer to a single collected answer. Often times we specify “Collected Data” just to be extra clear that this came from a user filling out and submitting a Form.

How it works

Think of the Calculation field as a vehicle engine. An engine is designed from the ground up to operate well if the correct parts are installed in the correct places. In the same way, the calculation field has been built from the ground up to have the correct formulas and components installed in the correct places. Simple calculations, once the basics have been learned, are really easy to put together.

Calculation Window

If you add a Calculation field to the form you are building in the form builder, you will notice a field settings area for the field you just added. If you scroll down the page on the right side you will see an area called “Calculation Field Formula” with two boxes beneath it. The blank box below on the right is where all the magic happens. This is where you will be writing your calculations. Simple or Complex, it pretty much all happens here. The Window on the bottom left is a drag and drop area. You can see the names of the other fields you have created, and drag them into the window on the right without having to know the exact field key you are looking for. This Drag and drop system will also automatically add the $ symbol on each side of the field key so that you do not have to add them manually.

$ Symbol

The “$” symbol is an important part of performing calculations in the Calculation field. The “$” symbol essentially tells the Calculation field that the very next set of numbers, letters, symbols is a field key, and it will continue to do so until you end with another $. Think of it like a set of book ends. A pair of book ends on a bookshelf support a set of books in between. In the same way the $ sign supports your field key in the midst of a Calculation. So your field key should looks something like this when placed into the Calculation field:

$numeric_1$ or $StartTime$ or $customerName001$

In the first example “numeric_1” is your unique field key. The first “$” tells the Calculation to “START reading unique field key!” and the end “$” is telling it to “STOP reading unique field key!”.

NOTE: The Calculation field specifically pulls the COLLECTED data from the fields you designate with a field key in your form. Similarly, if a “Default Value” is set in your form, the Calculation field will pull that value as the collected data, unless changed.

Validator Tool

To say it simply, the validator tool checks if your calculation is Valid. It will be able to check scripts and normal calculations. That being said, it will not be able to find every issue. Its functionality is mainly intended to give you an idea of what kind of problems are in your script/calculations. The Validator tool checks ALL SCRIPTS and CALCULATIONS in your form, it can also check a few issues with RULES as well. How start the Validator Tool: Make sure you are in your form builder in the Fastfield Portal online. Click on the “Setup” Button (cogwheel symbol) > Dropdown to “Validate Form”. Here is an article that explains more about the validator tool: https://mergemobile.zendesk.com/hc/en-us/articles/210200313

Have more questions? Submit a request

Comments

Powered by Zendesk