I got an empty token value, what could be the cause and how to correct it?

Some common causes leading to an empty SharnPix token value are:

  • Automations such as Flows, Triggers, or Process Builder block the proper generation of the token.

  • Users attempting to generate a SharinPix token without having proper access to the SharinPix token field. In cases involving the token generation using automation such as Flows, Triggers, or Process Builders, the user launching them should have edit access rights on the SharinPix Token field.

  • Records are created before activation of the automation that populates the token fields. It could happen that a record containing the SharinPix Token field has been created before the activation of the automation or during the deactivation of the automation. In such cases, the SharinPix Token field will not be populated with the generated token. Here, the token should be generated manually. The next section details how you can manually generate a token on a record.

  • It may also happen that users accidentally delete the token value in the fields. Therefore, we recommend the activation of Field History Trackingarrow-up-right to keep track of changes that might have taken place in such fields.

How to manually generate a token? (Some developer skills required)

By modifying your current Flow

If the token generation Flow triggers the token generation only at the creation of the record, you simply need to:

  • Modify the Flow so that it triggers when a record is being created and updated instead of only upon record creation.

  • Once the Flow is modified:

    • Go to the record having the missing token.

    • Perform a simple update on the same record in order to trigger the Flow so that it performs the token generation. You can just click on the Edit button followed by the Save button for the update to perform the same.

  • Finally, revert the modification on your Flow so that it only triggers upon the creation of records again.

If the Flow is already configured to be triggered upon the update of the records, then you simply need to perform a simple update on the record missing the token in order to regenerate the token. No need to modify the Flow in this case.

Using the TokenGeneration Apex class

To manually generate a SharinPix upload token, you can make use of the Apex class TokenGeneration available in the SharinPix package.

Follow the steps below to do so:

  • Open your Developer Console

  • Click Debug | Open Execute Anonymous Window to open the Enter Apex Code window

  • Then, execute the following code snippet:

circle-exclamation

DEPRECATED: By modifying your current Process Builder

If your Process Builder triggers the token generation only at the creation of the record to generate the missing token, you simply need to:

  • Modify your Process Builder so that it triggers when a record is being updated instead of on its creation.

  • Then, go to the record having the missing token.

  • Perform a simple update on the same record in order to trigger the Process Builder so that it performs the token generation. You can just click on the Edit button followed by the Save button for the update.

  • Finally, revert the modification on your Process Builder so that it triggers upon the creation of records again.

If your Process Builder is already configured to be triggered upon the update of the records, then you simply need to perform a simple update on the record missing the token in order to generate the token. No need to modify the Process Builder in this case.

circle-info

If you need assistance in generating missing tokens on existing records, kindly contact the SharinPix Support team using theSharinPix Support tab in the SharinPix app within your Salesforce organization.

Last updated

Was this helpful?