SharinPix Form Formula Functions and Operators
Overview
SharinPix Form Elements can be configured using Formulas. Formulas are critical for creating dynamic, data-driven SharinPix Forms. By using a combination of functions and operators, you can:
- Control Visibility: Show or hide form fields based on other user inputs or external data.
- Validate Input: Ensure data meets specific criteria before submission.
- Generate Content: Calculate or display dynamic text based on the form's context.
This article covers the following:
Getting started
Functions and Operators overview
Operators
| Operator | Type | Description | Example | Result |
|---|---|---|---|---|
| - | Arithmetic | Subtraction | Amount_Due - Discount | Numerical Difference |
| * | Arithmetic | Multiplication | Quantity * Unit_Price | Numerical Product |
| / | Arithmetic | Division | Total_Sales / Number_of_Reps | Numerical Quotient |
| + | Arithmetic | Addition (also used for concatenating text strings) |
| Numerical Sum / Combined Text String |
| > | Comparison | Greater than | Service_Years > 5 | true or false |
| >= | Comparison | Greater than or equal to | Hours_Worked >= 40 | true or false |
| < | Comparison | Less than | Age < 25 | true or false |
| <= | Comparison | Less than or equal to | Issues_Count <= 250 | true or false |
| AND | Logical | Returns true if ALL expressions are true. | Tier = "Gold" AND Annual_Spend > 50000 | true or false |
| OR | Logical | Returns false if ANY expression is true. | Region = "West" OR Region = "East" | true or false |
Logical functions
BLANKVALUE
Determines if an expression has a value and returns a substitute expression if it does not. If the expression has a value, returns the value of the expression.
Use
BLANKVALUE(expression, substitute_expression)
- expression - expression to be evaluated
- substitute_expression - value to return when expression is blank
Info:
A field is not empty if it contains a character, blank space, or zero. For example, a field that contains a space inserted with the spacebar is not empty.
Formula Example
BLANKVALUE(Department, "Undesignated")
This formula returns the value of the Department field if the Department field contains a value. If the Department field is empty, this formula returns the word "Undesignated".
ISBLANK
Determines if an expression has a value and returns true if it does not. If it contains a value, this function returns false.
Use
ISBLANK(expression)
expression - expression to be evaluated.
Formula Example
ISBLANK(Department)
This formula returns true if the Department field is empty. If the Department field contains a value, the formula returns false.
NOT
Reverses the logical value of an expression. Returns true if the expression is false, and false if the expression is true.
Use
NOT(logical_expression)
logical_expression - condition to be evaluated.
Formula Use
NOT(ISBLANK(Department))
This formula returns true if the Department field contains a value, and false if the Department field is empty.
IF
Determines if expressions are true or false. Returns a given value if true and another value if false.
Use
IF(logical_test, value_if_true, value_if_false)
- logical_test - expression to be evaluated
- value_if_true - value to return if logical_test is
true - value_if_false - value to return if logical_test is
false.
Formula Example
IF(Total > 500, "Eligible for Discount", "No Discount")
This formula returns “Eligible for Discount” if the Total field is greater than 500. If Total is 500 or less, it returns “No Discount”.
CASE
Checks a given expression against a series of values. If the expression is equal to a value, returns the corresponding result. If it isn't equal to any of the values, returns a default result.
Use
CASE(expression, value1, result1, value2, result2,..., else_result)
- expression - field or value you want compared to each specified value.
- value1, result1, value2, result2, .... - result and value pairs.
- else_result - the value to return when the expression does not equal any values.
Formula Example
CASE(User.Department, "IT", 0.25, "Field", 0.15, 0)
This formula returns different discount rate based on the department entered.
- 25% on any person in the IT department.
- 15% for someone in the Field department.
- 0 is applied if the person doesn't belong to either of these departments.
Text & List functions
LEN
Returns the number of characters in a text string or the number of items in a list field.
Use
LEN(text_or_list)
text_or_list - field or expression whose length you want returned.
Formula Examples
LEN(PartNumber)
This formula returns the number of characters in a PartNumber text field.
LEN(SelectedProducts)
This formula returns the number of selected items in the SelectedProducts list field.
- If SelectedProducts =
[“Laptop", "Monitor", "Keyboard"]the formula returns3.
INCLUDES
Determines whether a multi-select picklist, list field, or text string contains a specific value. Returns true if the value is found, and false if it is not.
Note:
This function is case-sensitive when checking for text-values
Use
INCLUDES(list_or_text, value)
- list_or_text - The multi-select picklist, list field, or text value you want to search.
- value - The value or substring you want to check for in the list or text.
Formula Example
INCLUDES(Regions, "North")
- If Regions =
["North", "South"], it returnstrue. - If Regions =
["South", "East"], it returnsfalse. - If Regions =
["north"], it returnsfalsebecause the function is case-sensitive.
COUNTMATCHES
Determines how many times a specified value appears in a list, or how many times a substring occurs in a text.
Note:
This function is case-sensitive when checking for text-values
Use
COUNTMATCHES(list_or_text, value)
- list_or_text - The list or text field to search within.
- value - The exact value or substring to count.
Formula examples
COUNTMATCHES(Inspections.Status, "Passed")
- This formula returns the number of times “Passed” appears in the list returned by
Inspections.Status.
- If
Inspections.Status=["Passed", "Passed", "Failed"], the formula returns2.
COUNTMATCHES(Description, "error")
- This formula returns how many times the substring "error" appears in the Description text.
Number list functions
SUM
Returns the total of all numbers in a list. Only numeric values are allowed; non-numeric values in the list will raise an error.
Use
SUM(number_list)
number_list - list containing only number values you want to add.
Formula Example
SUM(SalesAmounts)
This formula returns the total of all numbers in the SalesAmounts list.
- If SalesAmounts =
[100, 200, 50], the formula returns 350.

0 Comments
Add your comment