The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Solved! Go to Solution.
Hi, @sajjadniazi
You can refer to the following documentation to listen for events after this report is loaded in JavaScript
How to handle events in a Power BI embedded analytics application | Microsoft Learn
When the session is about to expire, you can request a new token, you can refer to the JavaScript method in the following document to obtain it:
Refresh the access token in Power BI embedded analytics | Microsoft Learn
In addition, if you want to listen to the user's actions on the report, you can use the following Javascript functions:
How to handle events in a Power BI embedded analytics application | Microsoft Learn
Use these methods above to implement your needs. If you want to listen to these events globally, you need to use in JavaScript you can use:
window.addEventListener('click', function(event) {
console.log('Global click event triggers');
});
Window addEventListener() Method (w3schools.com)
This listens for global events, places the methods provided by the previous Power BI JavaScript into your global events, and sets the listening interval to ensure that the session doesn't time out back.
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @sajjadniazi
You can refer to the following documentation to listen for events after this report is loaded in JavaScript
How to handle events in a Power BI embedded analytics application | Microsoft Learn
When the session is about to expire, you can request a new token, you can refer to the JavaScript method in the following document to obtain it:
Refresh the access token in Power BI embedded analytics | Microsoft Learn
In addition, if you want to listen to the user's actions on the report, you can use the following Javascript functions:
How to handle events in a Power BI embedded analytics application | Microsoft Learn
Use these methods above to implement your needs. If you want to listen to these events globally, you need to use in JavaScript you can use:
window.addEventListener('click', function(event) {
console.log('Global click event triggers');
});
Window addEventListener() Method (w3schools.com)
This listens for global events, places the methods provided by the previous Power BI JavaScript into your global events, and sets the listening interval to ensure that the session doesn't time out back.
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.