How to Store Input Pen Drawings as Attachments in Salesforce
Last updated
Last updated
This tutorial will guide you through saving the signature as a file using an action component, ensuring that the signature is stored for future reference on the related record.
So, let's get started!
Input variables serve as a way to store information passed between different screens in the flow. Here, we create an input variable to store the related record information.
Create a new Screen Flow
Click on the "New Resource" button
Resource type => Variable
API name => RecordID (or your API Name)
Data Type => Text
Check "Available for input"
Add a Screen element
Enter an API name
Hide Header and Footer (if needed)
Drag the Avonni Input Pen component
Click on the "Open Component Builder" button to access all the Input Pen component's settings.
You have accessed the component builder at this stage, which is crucial in setting up the Avonni Input Pen component. Here's how you can proceed:
By choosing the signature template, you benefit from a pre-configured setupSelect the Signature Template: On the left panel of the component builder, you will find various templates. Locate and select the 'Signature' template. This template is specifically designed for capturing signatures or handwritten inputs.
Utilize Pre-Configured Settings: By choosing the signature template, you benefit from a pre-configured setup. This template is tailored to optimize the input pen component for signature capture, ensuring that essential settings are adjusted.
Review and Customize (Optional): Although the Signature template provides a ready-to-use configuration, you can review and customize the settings. Feel free to adjust aspects like pen color, size, or add additional functionalities as per your specific requirements.
In this step, we will set up the functionality to manually save the input pen signature into the related record's notes and attachments section in Salesforce. Follow these instructions for a clear configuration:
Enable Save Feature: Locate the 'Save as content document' section in the settings and toggle it on. This action activates the feature that allows the drawing to be saved.
Set Up Auto Save (Optional):
Enable the' Auto Save Content Document' option if you want the signature to be automatically saved.
Every signature drawn is automatically stored as a content document without additional user actions.
Content Document Title:
Set the 'Content Document Title' to name the saved file.
You can provide a fixed title or use a mapped value for a dynamic file name, adapting to different contexts or records.
Link to a Salesforce Record:
Use the 'Content Document linked entity ID' setting to connect the signature to a specific Salesforce record.
Map this setting to the variable you created in Step 1. This step is crucial for the functionality to work correctly.
Customize Save Button (Optional):
If you wish to provide a manual save option, you can edit the label of the 'Save as' button.
This customization allows you to tailor the button text to suit your users' needs or application context.
By following these steps, you will successfully configure the Avonni Input Pen component to save signatures or drawings directly into Salesforce, with options for both automatic and manual saving
Once your flow is created, you can add it directly on Salesforce. For example, we will add it to the contact record page using App Builder.
Don't forget to pass your current RecordID in your screen flow when adding your flow on a page using Lightning App Builder.