Forum Discussion
Pass value to the embedded app from custom visual
Hi,
same problem here.
In the other thread (link), you were saying that PowerBI uses iframe sandbox, maybe that is why postMessage is not working?
Regards,
Anatoliy
Correct. Custom Visuals API loads visuals in an iframe.
Why do you want to use postMessage?
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
- aarshps8 years agoFrequent Visitor
Sorry for the late reply.
It is possible to achieve what I was trying to do. What I had in mind is I have a button on my Power BI report. When I click on the button, a popup appears in the application where my Power BI report is embedded. So I wanted the application to recieve an event trigger when the Power BI report button is pressed. This was achieved using a custom visual that I wrote. The visual simply passed a string value to the parent windows so that I was able to recieve the event.
- v-viig8 years agoCommunity Champion
Thanks for the details.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
- Anonymous1 year agoNot applicable
v-viig Please can you confirm if this is possible? Looks like the sandboxed iframe is intercepting messages between the parent window and the custom visuals, to ensure only a certain list of events are handled.
Is there a way to define custom events for communication between the parent and the custom visuals?
- jwenger1007 years agoMicrosoft Employee
Did you end up having to use postMessage to accomplish it?
- jaredwbrown7 years agoFrequent Visitor
Hi aarshps , I am trying to accomplish something similar, did you accomplish this with postMessage? Is it possible to target the embedded application window directly, since the custom visual iFrame is contained first in another report iFrame? Do you know if it is possible to postMessage from the embedded application to the custom visual?
Thanks,
-Jared