Hi All..
I need to know how to play a sound from media control when my notification is showing up.
So, basically i want to play a sound when my notification is showing in the app.
Is this possible?
Thanks.
Solved! Go to Solution.
Hi @PytByt ,
You can use below formula to achieve this. Set the OnStart property of your app to:
:
Set(ShowNotification,false)
And for the notification formula, change it to:
Notify("Error", Error);Set(ShowNotification,true)
Finally, NotificationAudio.Autoplay=
ShowNotification
Regards,
Mona
Hi @PytByt,
Yes, the simplest approach is to set the autoplay property of the media control to the variable that triggers your notification.
NotificationAudio.Autoplay=
If( ShowNotification = true, true, false)
When the notification is closed or dismissed using a button you can use the reset function on the OnSelect property to end and reset the audio.
Button.OnSelect=
Reset(NotificationAudio);
You could also use the timer control if you want to limit the play duration by adjusting its autoplay property to your variable and its End property to reset the audio control.
This video from Mr. Dang outlines the process:
https://www.youtube.com/watch?v=Tm_OtW1EQZ8
Hopefully this is what you were after!
Documentation:
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/controls/control-audio-video
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/working-with-variables
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-reset
Hi @Anonymous
Is this a variable?
Reset(NotificationAudio);
because i mean it in literally notification, like when we use:
Notify("Error", Error);
Can i use this NotificationAudio.Autoplay=
If( ShowNotification = true, true, false)
but not as a variable?
Hi @PytByt ,
You can use below formula to achieve this. Set the OnStart property of your app to:
:
Set(ShowNotification,false)
And for the notification formula, change it to:
Notify("Error", Error);Set(ShowNotification,true)
Finally, NotificationAudio.Autoplay=
ShowNotification
Regards,
Mona
User | Count |
---|---|
227 | |
101 | |
93 | |
56 | |
30 |
User | Count |
---|---|
288 | |
116 | |
109 | |
62 | |
58 |