Difference between revisions of "Formula Builder"

From AgileApps Support Wiki
imported>Aeric
(Created page with "The Formula Builder lets you interactively define a Formula Expression. Here is an example: ::border To build that formula: # The User Field "…")
 
imported>Aeric
 
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
The Formula Builder lets you interactively define a [[Formula Expression]].  
The Formula Builder lets you interactively define a [[Formula Expressions|Formula Expression]].  
__TOC__
====Example====


Here is an example:
::[[File:FormulaBuilder.png|border]]


::[[File:FormulaBuilder.jpg|border]]
To build that formula:
# The "Order Amount" field was chosen, inserting <tt>order_amount</tt>
# The Operator "* Multiply" was chosen, inserting <tt>*</tt>
# The "Related to Customer" field "Discount" was chosen, inserting <tt>related_to_Customer.discount</tt>
# The '''[Check Syntax]''' button was clicked, to ensure validity.


To build that formula:
===How the Formula Builder Works===
# The User Field "Role" was chosen, to insert <tt>user.primaryteamrolename</tt>
#Write an [[Expressions|Expression]] into the field. Optionally use the buttons to help specify fields and operators:<br>[[File:FieldChooserButton.png|border]]
# The Operator "not equal" was chosen, to insert <tt>!=</tt>
#'''[Choose Field]'''
# The role name was typed in, enclosed in double quotes: <tt>"Director"</tt>
#* Click this button to bring up a field-chooser dialog
# The entire expression was surrounded in single quotes: <tt>'...'</tt>
#* Select a field.<br>'''Note:'''
# The '''[Check Syntax]''' button was clicked, to ensure validity
#** Lookup fields that go to {{type|}}s end with an angle bracket (<tt>></tt>)
#** Selecting a lookup field opens the list of fields available in the targeted record
#** Up to 4 lookup records can be traversed, as shown in the example below
#* Click '''[Insert Field]''' to insert the chosen field
#: [[File:FieldChooser.png|border‎]]
#'''Operator'''
#:Optionally, choose an [[Operators in Formula Expressions|Operator]] to build the expression. (When adding values to compare against, be sure to put String values in single quotes. For example: <tt>State = 'CA'</tt>. Numbers do not need to be in quotes.)
#'''[Choose Function]'''
#: Choose from a list of available [[Formula Functions]]
 
===Considerations===
:* To compare to a string, use single quotes: 'ABC Co.'
:* The return value of the expression must match the return value selected for the formula. (The '''[Check Syntax]''' button verifies that it does.)
:* To return a text string, the value returned should be a field of type Text (<tt>related_to_customer.name</tt>), or a literal string enclose in single quotes (<tt>'sample'</tt>
:* To return a Boolean, use an <tt>IF</tt> expression that returns true or false:
::<tt>IF(related_to_Customer.customer_name = 'ABC Co.', true, false)</tt>
::

Latest revision as of 22:33, 9 May 2014

The Formula Builder lets you interactively define a Formula Expression.

Example

FormulaBuilder.png

To build that formula:

  1. The "Order Amount" field was chosen, inserting order_amount
  2. The Operator "* Multiply" was chosen, inserting *
  3. The "Related to Customer" field "Discount" was chosen, inserting related_to_Customer.discount
  4. The [Check Syntax] button was clicked, to ensure validity.

How the Formula Builder Works

  1. Write an Expression into the field. Optionally use the buttons to help specify fields and operators:
    FieldChooserButton.png
  2. [Choose Field]
    • Click this button to bring up a field-chooser dialog
    • Select a field.
      Note:
      • Lookup fields that go to Custom Objects end with an angle bracket (>)
      • Selecting a lookup field opens the list of fields available in the targeted record
      • Up to 4 lookup records can be traversed, as shown in the example below
    • Click [Insert Field] to insert the chosen field
    border‎
  3. Operator
    Optionally, choose an Operator to build the expression. (When adding values to compare against, be sure to put String values in single quotes. For example: State = 'CA'. Numbers do not need to be in quotes.)
  4. [Choose Function]
    Choose from a list of available Formula Functions

Considerations

  • To compare to a string, use single quotes: 'ABC Co.'
  • The return value of the expression must match the return value selected for the formula. (The [Check Syntax] button verifies that it does.)
  • To return a text string, the value returned should be a field of type Text (related_to_customer.name), or a literal string enclose in single quotes ('sample'
  • To return a Boolean, use an IF expression that returns true or false:
IF(related_to_Customer.customer_name = 'ABC Co.', true, false)