SharinPix Form Formula: Fields and Attributes
Overview
The SharinPix Form Formula Field allows you to dynamically reference and manipulate data. Using formulas, you can combine static values with live data coming from form inputs and other sources to create flexible, data-driven form templates.
This article covers the following:
Tips:
Follow this documentation to learn more about the Functions and Operators available in a SharinPix Form Formula Field
Getting Started
Formulas can reference data from the following sources:
- Current Form Fields: Values entered by the end-user (e.g.,
elementAPIName). - URL Parameters: Data passed when launching the form via the
form.params.prefix (e.g.,form.params.approval_threshold).
Accessing Form Fields
Any question with an API name can be used in a formula field. An API name can be added to a question using the API Name field on the form builder, as shown below.
The SerialNumber field can then be used in formula fields as shown above
A section or page cannot contain fields with the same API name.
Accessing nested fields
To access a nested field, i.e a field found inside a section, make sure to add an API name to the Section element as well. In the picture below the API name "Bedroom" is added to a Section element.
The "Bedroom" Section element contains a Radio question with the "ACWorking" API name as shown below.
To reference the "ACWorking" Radio question in a formula field found outside the "Bedroom" Section, it should be prefixed with the Section's API name as shown in the example below.
Tips:
A field can be referenced without any prefix if it is being used in the same level (i.e, the section where it is found)
Accessing Attributes of Form Fields
A field can contain several attributes based on its type and they can be accessed by adding a "." following a field API name.
Generic Questions attributes
These attributes are available on almost all questions.
| Attribute | Purpose |
|---|---|
| value | Returns the current value of the field |
| label | Returns the label of the question |
| note | Returns the current note added to the question if any |
| reference | Return the previous value of the question in the context of a follow-up form |
| visible | Returns whether the question is currently visible or not (This is available to use only if the question has a visibility formula configured) |
Section Attributes
These attributes are only available to sections.
| Attribute | Purpose |
|---|---|
| _questionsCount | Returns the number of visible questions that are inside the section |
| _questionsFilledCount | Returns the number of visible questions that have filled inside the section |
| index | Returns the index of the section if it a repeated section |
The API names of the questions inside the Section are also attributes of the Section.
If a Section is a Repeated Section, it will also have the index attribute, which returns its position in the Repeated element as shown below.
Repeated Sections attributes
These attributes are only available to the Repeated Sections element.
| Attribute | Purpose |
|---|---|
| size | Returns the number of sections added by the user |
The nested fields of the repeated sections can also be referenced. Follow this documentation to learn more.
Global form attributes
There are several global attributes that can be accessed by using the form keyword
| Attribute | Purpose |
|---|---|
| compare | Returns true when the form being filled is a follow-up form. |
| params | Allows accessing the url params found in the url that was used to load the form. Follow this documentation to learn more about this attribute. |
| response | Returns details of the SharinPix Form Response record. This can be used to show additional details on the SharinPix Form PDF. |
| template | Returns details of the SharinPix Form Template record. |
| view | Returns "print" in the context of pdf. This is useful for hiding or show specific fields on the SharinPix Form PDF. |
response attribute
This attribute of the form global field contains nested attributes about a SharinPix Form Response record created by the form.
| Attribute | Purpose |
|---|---|
| sfid | The Salesforce Record ID linked to the form response |
| sfname | The Salesforce Record Name linked to the form response |












0 Comments
Add your comment