SharinPix automatic mobile upload token generation (Admin Friendly)

This article demonstrates how to generate SharinPix tokens allowing image upload using the SharinPix mobile app only. Such token configuration is solely used for mobile uploads and not for album display.

Overview

This article demonstrates how to create a Salesforce Flow that will generate and store SharinPix mobile app tokens to upload images onto an album upon the creation of records.

To do this, we will:

circle-exclamation

Creation of the SharinPix Token field(s)

For this demo, we will use the Work Order object. Firstly, we need to create fields that will store the token generated. You have two ways of doing this:

  1. By creating a single field of type Long Text Area that will store the token.

  2. By creating multiple fields of type Text Area (255). In this case, the token will be split into chunks of a maximum of 255 characters. Each chunk will be then stored in the fields.

1. Creation on a single field to store the SharinPix Token

Create a field named SharinPix Token of type Long Text Area on the Opportunity object.

2. Creation of multiple fields to store the SharinPix Token

circle-check

Create three fields, of data type Text(255) and field labels:

  1. SharinPix Token 1

  2. SharinPix Token 2

  3. SharinPix Token 3

Creation of the Flow

circle-info

The SharinPix package includes the class TokenGeneration which contains a method that can be used to generate a token for an object. Using this method, the token generated can be automatically stored inside the user-defined field(s).

circle-exclamation

This section demonstrates how to create a Flow that invokes the apex class TokenGeneration in order to generate a token for newly-created/updated Work Order records.

To do so, follow the steps below:

  • Go to Setup. In the Quick Find Box, type Flows.

  • Under Process Automation , select Flows.

  • Click on the New Flow button.

  • Select the option Record-Triggered Flow , and click on the Create button.

  • After clicking on Create , the Configure Start modal will be displayed. Fill in the modal as indicated below:

    • Select Object : Work Order

    • Configure Trigger : A record is created or updated

    • Set Entry Conditions : None

    • Optimize the Flow for : Actions and Related Records

  • Click on Done to save the configurations.

  • Next, add an Action element.

circle-exclamation
  • On the _Action _modal, use the search bar to find the sharinpix__TokenGeneration Apex class.

  • Click on sharinpix__TokenGeneration.

  • On the _Action _modal for sharinpix__TokenGeneration , populate the fields as indicated below:

    • Label: Generate Mobile Upload Tokens

    • Description: Enter a description (optional)

    • Field API Name(s) : SharinPix_Token__c

      • Note: This is a mandatory field and refers to the SharinPix token field API name.

    • Record ID:{!$Record.Id}

      • Note: This is a mandatory field and refers to the current Work Order record Id.

circle-exclamation

There are other optional variables that are available in the _Action _modal, namely:

  • Custom Permission ID or Name: ID or Name of the SharinPix Permission object (of type Mobile Launcher) to be used for opening the SharinPix Mobile App.

  • Hours Before Token Expires: This can be used to set the number of hours before the token expires. This variable has a type Number and only takes integers as values. For example, if you want the token to expire in 3 hours, just enter 3 in the Value field.

  • Record Name: This can be used to reference the record name (or number) inside the token.

circle-exclamation

5. Click Done to save the Action configurations.

6. Save the Flow and activate it.

Find the SharinPix Token

Using the above Flow, tokens are generated/updated for all Work Order records created/updated.

The SharinPix Token can be found inside the SharinPix Token field of the newly-created/updated Work Order records.

Last updated

Was this helpful?