Display an image in a Salesforce field using Tag Action

SharinPix offers an easy way to generate image URLs upon tagging images using a process known as Tag Action.

Tag Actions can be configured in such a way so that when a specific tag is applied to an image, an image URL is generated and is automatically stored in a specified field. Therefore, this makes it possible to retrieve the URL generated and use the same in a Salesforce formula field to display the image on a record page.

For this demo, we will use the Account object.

To demonstrate how to add an image in a Salesforce field using Tag Action, we will:

  1. Create Salesforce fields to store the image URL and to display the specified image

  2. Create a tag to identify the required image

  3. Configure a Tag Action to automate everything

Create the Salesforce fields

For this implementation, you will first need to create two fields:

  • A field of type URL to store the image URL generated after the tag has been applied. For this demo, we will configure the field as follows:

    • Type: URL

    • Label: First Image URL

  • A Formula field which will use the image URL stored in the field created above, that is First Image URL, to display the image. For the formula field:

    • Field label: Image

    • Formula Return Type: Text

    • Formula:

IF(ISBLANK(First_Image_URL__c), "Image Not Found", IMAGE(First_Image_URL__c, ""))

circle-check
circle-exclamation

Create the tag and configure the Tag Action

Now that the fields are ready, go ahead and create a tag and a Tag Action by following the steps below:

  • Click on App Launcher and search for SharinPix Settings

  • On the SharinPix Settings tab, click on Go to administration dashboard button

  • Once on the dashboard, click on Tags from the top menu bar

  • Then, create the tag that will perform the tag action. Here, we will create a new tag named First Image using the following parameters:

  • After creating the tag, scroll down and click on the button named New Tag Action

  • Then, configure the new Tag Action as indicated below:

    • Field name: enter the API name of the newly-created URL field, that is First_Image_URL__c

    • Field value: here, you can choose your desired value, but for this demo we will opt for the Mini url value which will display the image in a smaller format

  • Click on Update Tag when done.

circle-check

Demo

Now that everything has been set up, we can go ahead and test our new implementation!

To do so:

  • Go to the Account record

  • From the SharinPix Album, tag the desired image with the First Image tag

circle-exclamation
  • After applying the tag, check if the Image and First Image URL fields have been populated correctly as demonstrated below:

circle-exclamation

Last updated

Was this helpful?