Save the Microphone recording file as an attached on a record
Overview
This tutorial teaches you how to automatically save and attach microphone recordings made with the Avonni Microphone component directly to a record within a Salesforce screen flow.
So, let's get started!
Final Outcome
![](https://flow.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252Fg6GbEZVyRsExMRZcr8iE%252FAvonni%2520Components%25205.0.gif%3Falt%3Dmedia%26token%3D864b0786-b385-43a9-b412-e3062e5bf325&width=768&dpr=4&quality=100&sign=b79f7b24&sv=1)
Steps
1. Create an input variable
Create an input variable: Input variables are essential in this process because they serve as a way to store information passed between different screens in the flow. We create an input variable in this particular flow to store the relevant record information.
This allows us to:
Link the recording to the correct record: By storing the record data in the input variable, we ensure that the microphone recording is accurately attached to its intended target within Salesforce.
Maintain context throughout the flow: The input variable lets different screens within the flow access and use the record information as needed, making the process more seamless.
Steps to create an input variable
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"
![](https://flow.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252Fn6Rtuj3zMBae82hCfeTx%252F2023-12-14_21-11-17%2520%281%29.gif%3Falt%3Dmedia%26token%3Dfe807b11-bf1b-4642-8b3d-42adeda35ac9&width=768&dpr=4&quality=100&sign=742bcb4a&sv=1)
2. Add a screen component and the Input Pen
Add a Screen element
Enter an API name
Hide Header and Footer (if needed)
Drag the Avonni Microphone component
Click the "Open Component Builder" button to access all the Microphone component's settings.
![](https://flow.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252FFofDG1Y8nGXxw3PdlATa%252F2024-04-09_21-01-47.png%3Falt%3Dmedia%26token%3D1d281018-2e7f-442c-a599-f4228d3ceae4&width=768&dpr=4&quality=100&sign=33f97d05&sv=1)
3. Configure the Avonni Microphone component to save recordings
You have accessed the component builder at this stage, which is crucial in setting up the Avonni Microphone component.
Here's how you can proceed to enable the saved recording as a content document:
Toggle the "Save as content document" setting.
![](https://flow.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252FA5e0fRYIKp6mZSczg553%252F2024-04-09_21-03-21.png%3Falt%3Dmedia%26token%3Da0358b68-e2d9-4ca1-a3dc-fce528df3619&width=768&dpr=4&quality=100&sign=e1eacf8f&sv=1)
Optional - toggle the "Auto Save Content Document" to let the Avonni Microphone automatically save the recording as a file on the page where this flow is added.
Enter a document title used as a document name when the recording is saved on Salesforce.
Mapped the variable created in Step 1 to ensure recording files are saved as content documents directly on the record page where the screen flow (containing the Avonni Microphone component) is used.
![](https://flow.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252FjExyQtBMLPgRgq3cKSPN%252F2024-04-09_21-10-13%2520%281%29.gif%3Falt%3Dmedia%26token%3D9b08b02d-4b79-4949-a2b0-444216bcf075&width=768&dpr=4&quality=100&sign=a7fe57cd&sv=1)
4. Add your flow to your Salesforce
Once your flow is created, you can add it directly on Salesforce. For example, we will add it to the opportunity record page using App Builder.
![](https://flow.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252FSzjnv13y1IAI6PfiD5qW%252F2024-04-15_20-03-42.png%3Falt%3Dmedia%26token%3D59079852-decd-476b-bf7b-1c68df3a66df&width=768&dpr=4&quality=100&sign=c1e86b1f&sv=1)
Remember to pass your current RecordID in your screen flow when adding your flow to a page using Lightning App Builder.
Last updated