Login    Sites MenuBlueStep

BlueStep Platform Support

RelateScript
Outline full outline 
Overview 
Data Types 
Operators 
Statements 
Functions 
Working with Relate Data 
Field Data 
Accessing Forms and Fields 
Accessing Fields 
Single Entry Forms 
Multi-Entry Forms 
Queries and Reports 
Searching 
Form Permissions 
Special Data and Functions 
How Formulas Work 
Related Topics 

Fields are always accessed by the formula id assigned to them when creating or editing the field settings.  They are unusual in that they have a consistent name across all formulas.  All other higher level data element have their name defined as part of the formula itself, and can be assigned a different name in each formula.  Fields always retain the name chosen when creating or editing the field. 

Formula ids for fields are unique within a given form to avoiding ambiguity if the form is known.  Thus, for field formulas the field's identifier alone is sufficient to unambiguously identify it since field formulas can only access a single entry of a single form.  For all other types of formulas the form's identifier must be specified as well as the field's.  How this is done is discussed in the next sections.  For now, examples will be given showing how to access fields in a field formula only.

Example: One common use of field formulas is to convert data from an easily edited format to another format that is easier to search on, sort on, or display.  A common example is to turn a URL into an HTML hyperlink for display.  If the url field has a formula identifier of 'url' and you wish to put the HTML hyperlink in a field with a formula id of 'link' you could add the following formula to either field:

link = '<a href="' + url + '">Click here</a>'

Example: Some types of fields have several internal values available.  A signature, for instance, contains a username, first name, last name and timestamp.  These values are accessed with a period after the field name.  So, to access the timestamp of a signature field with a formula id of 'sig' you would write:

sig.timestamp