# PlaySound when a Template is displayed

**URL:** <https://forum.inductiveautomation.com/t/playsound-when-a-template-is-displayed/36859>\
**Category:** Ignition\
**Tags:** ignition79, scripting\
**Created:** [July 20, 2020, 8:06am UTC](https://forum.inductiveautomation.com/t/playsound-when-a-template-is-displayed/36859 "2020-07-20T08:06:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicolas.griffon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nicolas.griffon/32/16603_2.png) [@nicolas.griffon](https://forum.inductiveautomation.com/u/nicolas.griffon)\
**Post date:** [July 20, 2020, 8:06am UTC](https://forum.inductiveautomation.com/t/playsound-when-a-template-is-displayed/36859/1 "2020-07-20T08:06:27Z")

</div>

Hello,

I’m currently trying to play a sound when a template is displayed in a Template Repeater.  
I’m using 7.9.14 version of Ignition.

I’ve tried to add the PlaySound function in the script used to refresh the Dataset of my Template Repeater but I figure that the sound is played on the Gateway because I don’t hear it.

What’s the best way to do what I want?

Is there a way to add a script on a Template when it becomes visible or it’s displayed on users screens?

Thank you

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 20, 2020, 11:08am UTC](https://forum.inductiveautomation.com/t/playsound-when-a-template-is-displayed/36859/2 "2020-07-20T11:08:32Z")

</div>

Have you tested that sound clip from the designer’s Script Console. Verify that, first.

---

<div class="post-metadata">

**Author:** ![nicolas.griffon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nicolas.griffon/32/16603_2.png) [@nicolas.griffon](https://forum.inductiveautomation.com/u/nicolas.griffon)\
**Post date:** [July 20, 2020, 12:04pm UTC](https://forum.inductiveautomation.com/t/playsound-when-a-template-is-displayed/36859/3 "2020-07-20T12:04:00Z")

</div>

The playsound function works well.  
In Designer’s Script Console and in the application (in a button’s script MouseClick)
