Tag Action

The Tag Action is a SharinPix feature used to update fields whenever a specific tag is applied to an image. It can be used both on standard and custom objects and is available both in Salesforce Classic and Lightning.

This article demonstrates how:

Note: 

Configuring the Tag Action requires access to the Administration Dashboard. For more information about how to access and use the Administration Dashboard, refer to the following article: Overview of the SharinPix Administration Dashboard

Enabling Tag action in Salesforce Classic Experience

To activate Tag Action in the Salesforce Classic Experience, simply add the code snippet below within a Visualforce Page. 

It is to be noted that the recordId attribute takes as value the Album Id (or the record Id) of the corresponding SharinPix Album. 

<sharinpix:TagAction recordId="{!$CurrentPage.Parameters.Id}" />
Click to copy

Enabling Tag action in Salesforce Lightning Experience

To activate the Tag Action on the Salesforce Lightning Experience, proceed as follows:

  • Drag and drop the SharinPix Album component from the Lightning App Builder onto your page layout.
  • Ensure that the Enable Action checkbox is set to true in the component's lightning parameters.
  • Save the page when you are done. 

Configuring Tag Action

To configure the Tag Action on a tag, proceed as follows:

  • Open the SharinPix Admin Dashboard.
  • From the top menu, select Tags.
  • Create or edit the tag on which you want to activate the Tag Action.
  • Enter the tag details if needed, then click on the New Tag Action button in the Tag Actions section located at the bottom of the page.
  • Configure the new Tag Action as indicated below.
    1. Field name: Insert the Salesforce API name of the field you want to update
    2. Value: Select between a predefined value or a custom one
    3. Click on Update Tag to save the action.
    4. Optional: Click on the button New Tag Action to create more Tag Actions for the current tag.

Note:

For the Tag Action to work properly, you should ensure that the users have access to the field applied to the Tag Action's configuration.

Below is the detailed list of Tag Action values. The field specified in the Field Name parameter will be populated with the selected Tag Action value.

Name Description
Width The original width of the image.
Height The original height of the image.
Full url The URL of the image with a maximum width and height of 1920px.
Large url The URL of the image with a maximum width and height of 200px.
Mini url The URL of the image with a maximum width and height of 100px.
Original  url The URL of the original image
Id The SharinPix ID of the image as stored in the database of SharinPix.
Geolocation Geolocation value found in the image metadata.
Fit to size A URL to the image fitted to the specified size.
Click here for more details about Fit to size.
Fill to size A URL to the image filled to the specified size.
Click here for more details about Fill to size.
Scale to size A URL to the image filled to the specified size.
Click here for more details about Scale to size.
Pad to size A URL to the image padded to the specified size.
Click here for more details about Pad to size.
Custom value Add a custom value to the field (can be a text, true or false, a numeric)
Watermark Adds a watermark on the image.
Click here for more details about how to add a Watermark.
Limit to size Sets a size limit.
Click here for more details about Limit to size.

Transformation

The difference between Fit, Fill, Scale, and Pad is as follows:

  • Fit to sIze: The image is resized so that it takes up as much space as possible within a bounding box defined by the given width and height parameters. The original aspect ratio is retained and all of the original image is visible.
  • Fill to size: An image is created with the exact given width and height while retaining the original aspect ratio, using only part of the image that fills the given dimensions if necessary (only part of the original image might be visible if the requested aspect ratio is different from the original aspect ratio).
  • Scale to size: Changes the size of the image exactly to the given width and height without necessarily retaining the original aspect ratio: all original image parts are visible but might be stretched or shrunk.
  • Pad to size: Resizes the image to fill the given width and height while retaining the original aspect ratio and with all of the original image visible. If the proportions of the original image do not match the given width and height, padding is added to the image to reach the required size.
  • Limit to size: Sets a size limit. If an image's dimensions exceed the limit value entered, the image is scaled down to that specified value.

The image below shows an example of how to configure a Tag Action with a Fit to size of value 500x500 px.

Note: 

  • When applying a transformation, the original image is not affected. 
  • The size can be specified by using <width>x<height> or <width and height>

Examples are:

  • 500x500 for a width and height of 500px. This can also be only written as "500".
  • 600x400 for a width of 600px and height of 400px.
  • 750 for a width and height of both 750px.

Tip:

For more information about fit, fill, scale, and pad, refer to the following article:

SharinPix Transformations Examples

Watermark

When choosing the option Watermark, the following is displayed in the Tag Actions section:

You can now set:

  1. The Image ID of the watermark image to be used in the Image field.
  2. The width of the watermark in the Width field.
  3. The height of the watermark in the Height field.
  4. Choose the watermark format in the field labeled Format. It can either be in pixels or in percentage.
  5. The opacity in the field labeled as Opacity.

Tip:

For more information about Watermark, refer to the following article:

SharinPix Transformation watermark entry

The Tag action in action

Assuming a Tag Action is properly configured, each time the tag is applied to an image, the tag action is executed and the selected value is inserted into the specified field.

Enable Tag actions for SharinPix Mobile App uploads

By default, the SharinPix Tag Action is not triggered when uploading tagged images using the SharinPix mobile app to prevent unintended Salesforce API usage. 

To enable this setting, perform the following steps:

  1. Open the administration dashboard

  2. Click on the settings tab

  1. Next, click on the Edit Organization button.

  1. On the settings edit page, tick the checkbox labelled “Run tag actions for uploads from the Sharinpix Mobile App".

  1. Click on the Update Organization button located at the bottom of the page to save the changes.

Note: 

Enabling this setting will increase your Salesforce API Usage.

Once the above setting has been enabled and assuming you configured a Tag action on a particular tag, images that are tagged with the later in the SharinPix Mobile App will run the associated Tag action when they are uploaded.

0 Comments

Add your comment

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