Add Image to Salesforce’s FSL Service Report

Deepak A
3 min readSep 3, 2022

At the time of this post, we have witnessed that when generating a Service Report under the Salesforce FSL, we cannot add an image as part of the generated report.

By image, I am not referring to Static images such as Company logos or signatures but dynamic ones such as Bar codes or QR codes related to a Work order.

Click here for detailed instructions on creating a Service report template within Salesforce FSL.

It is an everyday use case where businesses desire for the Service report to include images captured by the field engineer/ technician while at the customer’s site. Additionally, some of the customers also desire to display Bar codes or QR codes within the report.

As one can see in the below screenshot, a Bar code was generated within Salesforce and the same has been displayed within the Service report.

Barcode related to WO#

As mentioned earlier, the Service report template config/setup screen provides the option to add static images such as the company logo but getting images related to a WO is not yet supported.

This is where the IMAGE function within the formula field comes to our rescue.

Below are the steps required to implement this solution

  • Create a new custom field (text) ‘Bar Code Name Version ID’ (SMAX_PS_Bar_Code_Name_Version_ID__c) on the Work order object. Ensure the field has appropriate FLS and is visible on the page layout.
  • Create a new custom formula field (text) ‘Bar Code Image v1’ (SMAX_PS_Bar_Code_Imagev1__c) on the Work order. Ensure the field has appropriate FLS and is visible on the page layout.
  • Set the IMAGE function as shown here IMAGE(“https://<Salesforce-Domain>/sfc/servlet.shepherd/version/renditionDownload?rendition=ORIGINAL_Png&versionId=”& SMAX_PS_Bar_Code_Name_Version_ID__c &”&page=1", “Barcode”)
  • Once both field creations are completed, open the Service Report template where the image is required to be displayed. Add the newly created formula field on the report and click Save.
  • Navigate to one of the image files within Salesforce files. Click on View File Details
Navigate to one of the image files within Salesforce files. Click on View File Details
  • Once on the file’s detail screen click on Copy image address and paste it into a notepad for the future steps below.

Sample link: https://<Salesforce-Domain>/sfc/servlet.shepherd/version/renditionDownload?rendition=ORIGINAL_Png&versionId=0688c00000A0O4r&operationContext=CHATTER&contentId=05T8c00000fAvRy

  • In the URL, find the string versionId query parameter and extract the value associated with it such as 0688c00000A0O4r in the above example.
  • Edit one of the Work order record and set the versionId extract in the previous step into the ‘Bar Code Name Version ID’ (SMAX_PS_Bar_Code_Name_Version_ID__c) custom field.
  • On save, the corresponding image file should be displayed on the detail screen against ‘Bar Code Image v1’ (SMAX_PS_Bar_Code_Imagev1__c)

The only thing that remains to be done is an automation program (flow or a trigger) that would set the versionId on the Work order record on the creation of the file (content version).

--

--

Deepak A

7x Salesforce certified Application Architect | Certified Servicemax Administrator | Technical Architect at ServiceMax