Integration of SharinPix Form with SFS (FSL) App using App Extension

Overview

SharinPix Form can be integrated with the SFS (FSL) App using App Extension.

This article covers the following:

Information:

Salesforce Field Service (SFS) was formerly known as Field Service Lightning (FSL).

Assumptions:

  • The Work Order object will be used throughout this article.
  • The Work Order object has a custom field named SharinPix_Form_Token__c that holds a form token. If you haven't implemented this yet, refer to the article SharinPix automatic form token generation to generate the form token.

Getting Started

One method for launching the SharinPix App with the SharinPix Form from the SFS App is to create an App Extension. The latter can embed a URL referring to the SharinPix Form on the SharinPix App, where the form can be filled out.

In this article, you will learn how the SharinPix Form URL is integrated into the SFS mobile App using the SFS App Extension. 

SharinPix Form URLs 

The format for deeplinks to open a form in the SharinPix app is as follows:

sharinpix://form?token=<sharinpix-form-token>

The format for universal links (URL) to open a form in the SharinPix app is as follows:

https://app.sharinpix.com/native_app/form?token=<sharinpix-form-token>

Creation of the App Extension

An App Extension lets the user quickly access the SharinPix Form through the SharinPix Mobile App. In this section, we will create an App Extension that launches the SharinPix app from the SFS app.

  • Go to Setup, then type Field Service Mobile Settings in the Quick Find box. Click on Field Service Mobile Settings.
  • Click on the Field Service Mobile Settings item (Or any settings relevant to your Organization).
  • Scroll down towards App Extensions Section.
  • Click on Add. You will be prompted with the screen below:
  • For the Field Service Mobile Settings, select the relevant record to your Organization. In our case it is Field Service Mobile Settings.
  • For the Type, select Android if you intent to use the App Extension on Android platforms or select iOS if you intent to use on iOS platforms.
  • For the Launch Value, enter the following SharinPix Deeplink URL for Android platforms:
sharinpix://form?token={!SharinPix_Form_Token__c}
Click to copy

Or use the following SharinPix Deeplink URL if you intend to use the App Extension on iOS platforms:

sharinpix://form?token={!$SharinPix_Form_Token__c}
Click to copy

Warning: 

When referencing a Salesforce field name on iOS, you must prefix it with an additional $ (dollar sign). This is required by the iOS App Extension to interpret the field reference correctly.

Tips:

sharinpix://form refers to the URL that will launch the SharinPix Form through the SharinPix Mobile App. SharinPix_Form_Token__c refers to the custom field containing the SharinPix form token value defined in the previous sections. 

  • For the field Label, enter Fill Fire Safety Form
  • For the field Name, enter Fire_Safety_Form
  • For the field Scoped To Object Types, enter WorkOrder
  • Click on Save

Warning: 

  • An App Extension is only visible on the record page of its associated object. You should always ensure that you entered the correct object API name when creating the App Extension. 

For example, suppose you are creating an App Extension for the Work Order object, the API name entered in the field Scoped To Object Types should be WorkOrder.

If you are using a custom object named MyVisitObject, with MyVisitObject__c as the API name, you should enter MyVisitObject__c in the Scoped To Object Types field. 

  • For the following test, ensure that you have installed the SharinPix mobile app on your device.

You will find more information on where to find the SharinPix app in the article below:

http://docs.sharinpix.com/m/documentation/l/890606-where-to-find-the-app

Additional parameters can be used to access additional features when using the SharinPix Form. The features that can be used are:

Working around Salesforce App Extension limitations

Since there is a restriction on the number of characters an App Extension can have, a custom field can be added with the value containing all other mobile app parameters. The Deeplink URL will then be as follows:

sharinpix://upload?token={!SharinPix_Token__c}&{!Your__Custom_Field__c}

On iOS, since the Deeplink is encoded by Salesforce Field Service (SFS), the deeplink URL should then be written as follows:

sharinpix://upload?token={!SharinPix_Token__c}&sp_params={!Your_Custom_Field__c}

For example Your_Custom_Field__c can have the following value:

checklist=Bedroom;Kitchen&mode=systemcam

Prefill Functionality in SharinPix Form

SharinPix Form can automatically retrieve and display values from related Salesforce records. This feature, known as prefill functionality, allows form fields to be dynamically populated with data from the record where the form is launched. 

Configuration Steps

  1. Set up in Form Builder
    The prefill configuration must first be defined within the SharinPix Form Builder.
  2. Construct the Deeplink
    Once configured, you must construct the deeplink (SharinPix Form URL) with the values to prefill.

Prefill Parameter

To enable the prefill option, you must use the pv parameter followed by the API name of the form element.

  • Syntax:  pv<ElementApiName>=<Encoded Prefill Value>

The value must be URL-encoded before being passed.

The following example shows a deeplink that pre-fills the Name field with John Doe:

sharinpix://form?token=<Your Form Token>&pvName=John%20Doe

In this case:

  • pvName = API name of the form element
  • John%20Doe = URL-encoded value for “John Doe”

Multiple Prefills Using Formula Fields

If you need to prefill multiple fields in the same form, you can concatenate the parameters in a Salesforce Formula field.

  • Formula Example:  "pvName=" & TEXT(Name) & "&pvAddress=" & TEXT(Address)

Note:

When constructing deeplinks, ensure that all values are properly URL-encoded before being passed. This prevents unexpected behavior and guarantees that special characters are interpreted correctly.

To encode a field value in Salesforce, you can use the following formula:
SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(FieldName__c, '%', '%25'), '+', '%2B'), '&', '%26'), '#', '%23'), '?', '%3F'), ' ', '%20'), '_', '%5F'), '-', '%2D'))

  • Deeplink Example with Formula Field:

    sharinpix://form?token=<Your Form Token>&sp_params={!Formula_Field__c} 

This way, you can dynamically pass several prefill values at once using a single formula field.

Info: 
For more information on the Prefill Feature, please follow the article below: Default or Prefill Values

Comparative View

The Comparative View feature allows users to compare current form responses with previous submissions. This is especially valuable for follow-up forms, recurring inspections, or progress tracking, where referencing past inputs helps provide updated or more accurate information.

Comparative Parameter

To enable the comparative option, you must include the ref_response_url parameter in the deeplink.

  • Syntax:  ref_response_url=latestFormResponse

The following deeplink demonstrates how to add the comparative parameter to a deeplink:

sharinpix://form?token=<Your Form Token>&ref_response_url=latestFormResponse 

Info:
For more information on the Comparative Feature, please follow the article below: Initial/Follow-up Form Responses (Comparative)

Creation of an App Extension embedding a Field Service Mobile Flow

You can also use App Extensions to launch Field Service Mobile Flows from the SFS app. 

To do so, you simply need to select Flow as the Type and use the Flow's API name as the Launch Value in the App Extension detail page as demonstrated below:

Tip:

To learn how to integrate the SharinPix App with SFS using Flows, refer to the following article:

Integration of SharinPix App with SFS (FSL) App using Flows

Launching the SharinPix app

Warning:

App Extensions are cached on the Salesforce Field Service mobile app. Therefore, it may happen that changes made to App Extensions are not applied instantly on devices. To ensure that the changes are applied, you can clear the cache on the SFS app as follows:

On the SFS app, go to ProfileSettingsAdvanced SettingsClear Cached Metadata

If the changes made to the App Extension are still unavailable after clearing the cache, try logging out and back in the SFS app to force a refresh.

You can now launch the SharinPix app from SFS.

  • Open the SFS app.
  • Choose the Service Appointment record of a WorkOrder record.
  • Select Actions.
  • Then select Inspection Form. This option refers to the newly-created App Extension.
  • You will then be directed to the SharinPix Form via the SharinPix app.

0 Comments

Add your comment

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