Special Value Variables
What are Special Value Variables?
Special value variables are used in both Pulsar Settings Language (PSL) and in JSAPI.
The table on this page lists the variables, definitions, and formats specific to PSL and JSAPI.
How to use the Special Value Variables
Find examples for how to use some of the variables here:
Setting Name | Data Type | JSAPI | PSL | Description |
---|---|---|---|---|
Current User Id | Reference | userid (see userInfo) | @@CurrentUserId | The current Pulsar user's Id |
Current Username | String | username (see userInfo) | @@CurrentUsername | The current Pulsar user's username |
Current User Locale | String | locale (see userInfo) | @@CurrentUserLocale | The current Pulsar user's locale Id |
Current User Language | String | userlanguage (see userInfo) |
| The language and region. |
Current User Full Name | String | userfullname (see userInfo) | @@CurrentUserFullName | The current Pulsar user's full name |
Current Profile ID | Reference | userprofileid (see userInfo) | @@CurrentProfileId | The current Pulsar user's profile Id |
Current Profile Name | String | userprofilename (see userInfo) | @@CurrentProfileName | The current Pulsar user's profile name (Access to this value requires the user to have access to the "Profile" SObject) |
Current Role ID | Reference | userroleid (see userInfo) | @@CurrentRoleId | The current Pulsar user's role Id |
Current Role Name | String | userrolename (see userInfo) | @@CurrentRoleName | The current Pulsar user's role Name (Access to this value requires the user to have access to the "UserRole" SObject) |
Current Organization ID | Reference | organizationid (see userInfo) | @@CurrentOrganizationId | The Org Id of the current Pulsar user |
Today | Date | @@Today | Current date | |
Now | Datetime | @@Now | Current date-time formatted for the Salesforce API, which can be used in to fill Salesforce datetime fields | |
Convert to Salesforce Time | Datetime | @@ConvertToSFTime | converts a sqlite timestamp to a SFDC timestamp. Requires using the TimeString parameter of the SetVar Action. See example above. | |
Current Scan Code | String | @@CurrentScanCode | if you are using the barcode scanner to access the value that was just read from a barcode or a QR code | |
Current Location | Geolocation | @@CurrentLocation | grabs the latitude and longitude coordinates (with medium location accuracy) of the device's current position. These values are then accessible by using the resulting variable name and appending '__Latitude__s' and '__Longitude__s' to the variable name. If you require fine- or coarse-grained acuracy, consider using the SetLocation/InMemory action/s. | |
Create Object ID | Reference |
| @@CreatedObjectId | This is used during the onSave trigger for retrieving the id for the object that was just created. |
App Version | String | version (see userInfo) | @@AppVersion | The current Pulsar App's version, e.g. "4.1.0.101" |
FSL Version | String |
| @@FSLVersion | The current version of Pulsar’s Field Service Lightning app, e.g. “14.0.0” |
Proxy Server | String |
| @@ProxyServer | Currently this stat is only supported on the Pulsar Windows App. This returns the configured proxy server if it exists and returns the empty string otherwise. |
Last Sync Success | String | lastsyncsuccess (see syncinfo) | @@LastSyncSuccess | This is TRUE or FALSE depending on the success or failure of the last sync attempt |
Last Sync Time | Datetime | lastsuccessfulsync (see syncinfo) | @@LastSyncTime | The date/time after the most recent successful sync has finished integrating records. "1970-01-01T00:00:00.000Z" will be returned when a sync has never completed. |
Synced Data Timestamp | Datetime | synceddatatime | @@SyncedDataTime | The latest timestamp for which the sync would have successfully downloaded data, based on the created/modified time of the data. This can be different from the last completed sync time, especially if last sync was resuming an older interrupted or failed sync. "1970-01-01T00:00:00.000Z" will be returned when a sync has never completed. |
Last Sync Duration | Integer | lastsyncduration (see syncinfo)
| @@LastSyncDuration | The last sync duration in seconds. 0 will be returned when a sync has never completed. |
Last Failed Sync Time | Datetime | lastfailedsync (see syncinfo) | @@LastFailedSyncTime | The date/time of the last failed sync. "1970-01-01T00:00:00.000Z" will be returned if a sync has never failed. |
Last Failed Sync Duration | Integer |
| @@LastFailedSyncDuration | The last failed sync duration in seconds. 0 will be returned if a sync has never failed. |
Last Failed Sync Error Code | Integer | lastfailedsyncerrorcode (see syncinfo) | @@LastFailedSyncErrorCode | The specific Pulsar error code that caused the last sync to fail. 0 will be returned if a sync has never failed. This stat, along with other ‘Last Failed’ stats below continue to be reported with information from the last time an error was encountered even if subsequent syncs are successful. Collectively, these ‘Last Failed’ stats can help drill down into why a sync may have failed. For example, this stat may indicate an error code of ‘205’ which tells us that Pulsar encountered an issue when trying to push a record change to Salesforce. To find out why Salesforce specifically rejected the request, the SF Error Code/Message stats below may have that information. |
Last Failed Sync CURL error code | Integer | lastfailedsynccurlerrorcode (see syncinfo) | @@LastFailedSyncCurlErrorCode | The specific error code returned from CURL (network communication open source library). 0 indicates there was no error. |
Last Failed Sync CURL error message | String | lastfailedsynccurlerrormessage (see syncinfo) | @@LastFailedSyncCurlErrorMessage | The specific error message returned from CURL (network communication open source library). |
Last Failed Sync Salesforce error code | String | lastfailedsyncsferrorcode (see syncinfo) | @@LastFailedSyncSfErrorCode | The specific error code (not numeric) that comes from Salesforce. ‘FIELD_CUSTOM_VALIDATION_EXCEPTION’ is an example of this type of error code. Since this is a string rather than a number, a blank value indicates no error. |
Last Failed Sync Salesforce error message | String | lastfailedsyncsferrormessage (see syncinfo) | @@LastFailedSyncSfErrorMessage | The specific error message that comes from Salesforce. This is linked to the Salesforce error code above and would contain specific details about the error. |
Last Failed Sync HTTP response code | String | lastfailedsynchttpresponsecode (see syncinfo) | @@LastFailedSyncHttpResponseCode | The specific HTTP code that is returned from Salesforce. This stat is recorded when either CURL reports an error or when there was no body found in the response from Salesforce and the HTTP code is not 200 (OK) and not 204 (No Content). The specific error code (not numeric) that comes from Salesforce. ‘500 Internal Server Error’ is an example of this type of error code. Since this is a string rather than a number, a blank value indicates no error. |
Local Created Count | Integer | localcreatedcount (see syncinfo) | @@LocalCreatedCount | The number of local created records sent to the server |
Local Deleted Count | Integer | localdeletedcount (see syncinfo) | @@LocalDeletedCount | The number of local deleted Ids sent to the server |
Local Updated Count | Integer | localupdatedcount (see syncinfo) | @@LocalUpdatedCount | The number of local updated records sent to the server |
Local Updated Unique Count | Integer | localupdateduniquecount (see syncinfo) | @@LocalUpdatedUniqueCount | The number of unique updated records sent to the server. This can be less than Local Updated Count if your organization has enabled the chronological changes feature. |
Server Processed Count | Integer | serverprocessedcount (see syncinfo) | @@ServerProcessedCount | The number of full or partial records retrieved from the server for any reason across all object types. |
Server Processed Object Count Map | String | serverprocessedobjectcountmap (see syncinfo) | @@ServerProcessedObjectCountMap | A string containing a comma separated list containing pairs of object types to processed counts (eg, “Account: 1000,Contact:500”). |
Server Integrated Count | Integer | serverintegratedcount (see syncinfo) | @@ServerIntegratedCount | The number of retrieved records ultimately added or updated on the local device |
Sync Domain Type | String | syncdomaintype (see syncinfo) | @@SyncDomainType | all = standard initial or catchup sync, mini = catch-up sync with a subset of objects, single = a sync that at minimum syncs a single object, but can also sync up to one level above (via parent/lookup relationships) and one level below (via child relationships) push = a sync that only pushes local changes to the server. |
Sync Window Type | String | syncwindowtype (see syncinfo) | @@SyncWindowType | initial = The first sync performed after installing the app. catchup = Any sync that is performed after the initial sync and is not a complete sync. complete = A sync that is not an initial sync, but is performing a full sync due to a setting change. |
Sync Resumed | String | syncresumed (see syncinfo) | @@SyncResumed | Returns YES if the last sync was a continuation of an incomplete sync, and returns NO otherwise |
Sync Pass Count | Integer | syncpasscount (see syncinfo) | @@SyncPassCount | Number of passes that were performed with the last sync |
Schema Changed | String | schemachanged (see syncinfo) | @@SchemaChanged | Returns YES if the last sync detected a schema change and performed a schema migration, and returns NO otherwise |
Sync Generation | Integer | syncgeneration (see syncinfo) | @@SyncGeneration | Number of total sync passes since app was installed |
Metadata Sync Performed | String | metadatasyncperformed (see syncinfo) | @@MetadataSyncPerformed | Returns YES if the last sync performed a metadata sync, and returns NO otherwise |
Metadata Sync Duration | Double | metadatasyncduration (see syncinfo) | @@MetadataSyncDuration | Number (#.#) of seconds that the metadata sync took |
Reachability Sync Performed | String | reachabilitysyncperformed (see syncinfo) | @@ReachabilitySyncPerformed | Returns YES if the last sync performed a reachability sync, and returns NO otherwise |
Reachability Sync Duration | Double | reachabilitysyncduration (see syncinfo) | @@ReachabilitySyncDuration | Number (#.#) of seconds that a reachability sync took |
Refresh Performed | String | refreshperformed (see syncinfo) | @@RefreshPerformed | Returns YES if the last sync resulted in refreshing the session and settings before sync began, and returns NO otherwise |
Refresh Duration | Double | refreshduration (see syncinfo) | @@RefreshDuration | Number (#.#) of seconds that refreshing the settings and session took |
Local Changes Pending Count | Integer |
| @@LocalChangesPendingCount | The number of creates, updates, or deletes performed locally that have not yet been sent to the server |
Previous Sync Date/Time
| Datetime | previoussynctime (see syncinfo) | @@PreviousSyncTime | Returns the date and time of the sync window end date for the successfully completed sync that happened before the current sync (regardless of whether the current sync was successful). "1970-01-01T00:00:00.000Z" will be returned when a sync has never completed at least two syncs. Note, this stat should be the same as SyncedDataTime if the current sync failed. |
Device Language | String | devicelanguage (see userInfo) |
| The device language returned as a 2-digit code |
Instance URL | URL | instanceurl (see userInfo) |
| The URL of the instance. |
Session ID | String | sessionid (see userInfo) |
| The session ID |
User Full Photo | URL | userFullPhoto (see userPhoto) |
| The URL of the user’s full size photo. |
User Small Photo | URL | userSmallPhoto (see userPhoto) |
| The URL of the user’s small photo. |
Location Accuracy | String | locationAccuracy (see getLocation) |
| The level of geolocation accuracy. Values are Fine, Medium, Coarse. Default value is Medium. |
Latitude | Double | latitude (see getLocation) |
| The current device latitude. |
Longitude | Double | longitude (see getLocation) |
| The current device longitude. |
Label Names | String | labelNames (see getCustomLabels) |
| Returns the values associated with Salesforce Custom Labels. |
Log Message | String | message (see Logging) |
| The log message in the Pulsar log. |
Log Level | String | level (see Logging) |
| The optional log level of the log message for the Pulsar log. Default is info. Other values are warn, error, and debug. |
How to access the current user’s data on the current record
In addition to the values listed in the table, the field values for the current user on the current record can be obtained by using the special variable, @@currentuser. The syntax for this is: @@currentuser.fieldname. The field name is any valid field API name in the current record, for example, @@currentuser.FirstName.