Enable Audio Playback in Dynamics 365 Contact Forms Using JavaScript
November 02, 2025
#Dynamics 365
Ushaswi Gurrampati
In many business scenarios, customer-specific audio instructions, call recordings, or diagnostic voice notes need to be stored and reviewed inside Dynamics 365.
However, Dataverse does not provide any built-in way to automatically play audio files stored in File columns.
In this blog, I will demonstrate how to:
Store audio files in Dataverse File columns.
Retrieve those files using the Web API.
Automatically play them inside the Contact form using JavaScript.
This solution enhances the user experience by allowing CRM users to listen to audio instructions directly from the record without downloading files.
Business Scenario
Our organization stores voice notes for contacts—such as
Customer-specific instructions
Feedback recordings
Support voice notes
Each contact record has a file column named xyz_audiofile.
Whenever the user toggles the Play Audio checkbox, the audio file should automatically play.
Navigate to the Contact table and open the Forms section.
Open the main Contact form in edit mode so that event handlers can be added.
Add the audiofile field to the form.
Inside the form editor, open the Form Libraries section and click Add Library.
Select the xyz_PlayContactAudio.js file and add it to the form.
Select the Audio File field on the form and open its Events panel.
Add a new On Change event handler and choose the xyz_PlayContactAudio.js library.
Set the function name as XYZSoundApp.PlayAudio.playContactAudio and enable the option to pass the execution context.
Save and publish the form after completing this configuration.
Open any existing Contact record and upload an audio file in the Audio File field.
Save the record so that the file is stored inside Dataverse.
Click anywhere on the form once to allow browser interaction and observe that the uploaded audio file starts playing automatically.
Audio instructions and customer voice notes often go unused in Dynamics 365 because they require file downloads. This solution enables direct audio playback from Contact records using a Dataverse File column and JavaScript. It enhances user productivity by allowing instant access to voice recordings within the CRM interface.
Frequently Asked Questions (FAQs):
1. Which audio formats are supported?
The solution works best with .mp3 and .wav file formats.
2. Why does the audio not play automatically on form load?
Modern browsers block auto-play until the user interacts with the page at least once.
3. Do I need Power Automate or plugins for this feature?
No, the entire solution works using client-side JavaScript and the Dataverse Web API.
4. Can this be used for other tables like Case or Account?
Yes, the same approach can be applied to any Dataverse table by updating the entity name and field logical name.