EPIC scripts are preset actions that can be utilized within most form designs.
To add an EPIC Script to the Form, first click in a control's text area
Go up to Insert > EPIC Script and then choose the option that you are looking for.
check & uncheck
The check/uncheck scripts is used specifically for a Check Box control. Use them in tandem with one another to remove or place a check in a specific checkbox when something else occurs within the form. Like most other scripts and formulas, "if" statements are essential to complete the task.
In this example: We want a specific inspector to be checked depending on whether the of the field totals greater or less than 50 acres.
=if(actualAcres>=50){check(InspectorA)uncheck(InspectorB}
else{check(InspectorB) uncheck(InspectorA)}
enable & disable
The enable/disable scripts will change a text control item from read-only to editable and vice-versa. They can be used in "if" statements to have a variety of control. Note: Drop Down Lists and drop down options within a Drop Down Combo are not able to be disabled at this time.
In this example we are enabling a specific text box control called "Verification" based on if the "InspectedStatus" control contains the the exact string of "Yes".
=if(InspectedStatus = "Yes"){enable(Verification)}
else{disable(Verification)}
emailSummaryForm (Action)
This script will email a separate form that can serve as a summary of what it on the current form.
See the Email Form Scripts - emailSummaryForm & emailThisForm Actions support page for greater detail.
emailThisForm (Action)
This script will email a pdf of the current form upon save. It can also attach an ESRI shapefile, KML file, and/or a SatLoc® job file.
See the Email Form Scripts - emailSummaryForm & emailThisForm Actions support page for greater detail.
hide & show
The Hide command will remove an item on the Form from view upon a command in the body of the formula.
The Show command will make an item visible on the Form.
A majority of the time, the show and hide formulas are used in conjunction with each other.
"if" statements are able to be used in a way to allow you to hide fields based on other selections in or inputs in the form. For example, If you wanted the Approved By field to appear only if the Status field was set to "Completed" then you would use the show and hide commands in your formula.
In this example, we want to have the "Approved By" field show up after the "Status" field has been changed to "Completed". It is important to note that this formula can be placed in any text field or label. It might be beneficial to place it in its own label so that it is always hidden from view and does not possibly disrupt any other formulas.
=if(Status='Completed'){show(ApprovedBy)}
else{hide(ApprovedBy) }
The else statement is important to include so that the "Approved by" field will be hidden again if the Status is changed back to something other then "Completed".
It is possible to stack more than one hide and or show statement within a formula. Simply list the commands within the curly brackets of an if statement {}.
Note:Do not use the && command within the curly brackets of an if statement.=if(Status='Completed'){show(ApprovedBy)show(ApprovedbyLabel)}
else{hide(ApprovedBy)hide(ApprovedByLabel)}
subString
The subString function is used to pull a certain part of a value by setting up the start position and telling the program how many spaces to gather.
=subString(string, start position, optional length)
- string can be a field name or literal
- start position is a number for the starting position (can also use an inString script)
- length is an optional number for the length
inString
An inString is used to locate specific values from a value or String of data. You can search for specific values as well as where to look for them at. Note: inString is Case Sensitive=inString(string, search string, optional start position)
- string can be a field name or literal
- search string is the string to search for
- start position is an optional number for the position to start searching from
Many times, subString and inString are used together to find or separate a specific value from another.
For Example: use the "inString" to locate the starting position (the negative(-) sign before the longitude number) for the subString script to parse out only the Longitude number from a lat/long string(in decimal degree format)
The subString is grabbing 10 characters from the control called LatLong and it is using the inString to locate where to start (the negative sign (-)) the 10 characters at.
=subString(LatLong, inString(LatLong,"-"), 10)
So if the control called "LatLong" contains:
47.818101 -97.464089
Then the formula will produce this result:
-97.464089
RoundUp/RoundDown
The Round Up and Round Down functions force a number to round up or down to the desired decimal placement.
RoundUp
=roundUp(number,precision)
RoundDown
=roundDown(number,precision)
- "number" can be a literal number, reference other controls, or contain a formula and is the number that will be rounded
- "precision" is used to determine the decimal position to round to. 0 = whole number, 1 = tenth, 2 = hundredth
- This can be either a literal number or referencing a separate control
Lets use a sum script that has a value of "154.12289" and round to the tenths.
=roundUp(sum(ProductTotals),2)
The result would be:
154.2
Using an if statement with the roundUp function
=if(TankSize= "1200 gal (ground)")
{roundUp(TotalLoad/1200,0)}
elseif(TankSize="500 gal (air)")
{roundUp(TotalLoad/500,0)}
Related Pages:
Contact AgriData, Inc. Support
701-746-8580
info@agridatainc.com