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

OperatorTypeDescriptionExampleResult
-ArithmeticSubtraction Amount_Due - DiscountNumerical Difference
*ArithmeticMultiplication Quantity * Unit_PriceNumerical Product
/ArithmeticDivision Total_Sales / Number_of_RepsNumerical Quotient
+ArithmeticAddition (also used for concatenating text strings)

Hours_Worked + 24 (Numerical sum)  

First_Name + " " + Last_Name(Text Concatenation)

Numerical Sum / Combined Text String
>ComparisonGreater than Service_Years > 5true or false
>=ComparisonGreater than or equal toHours_Worked >= 40true or false
<ComparisonLess thanAge < 25true or false
<=ComparisonLess than or equal toIssues_Count <= 250true or false
ANDLogicalReturns true if ALL expressions are true.Tier = "Gold" AND Annual_Spend > 50000true or false
ORLogicalReturns 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 returns 3.

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 returns true.
  • If Regions = ["South", "East"], it returns false.
  • If Regions = ["north"], it returns false because 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 returns 2.

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

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.