Files img preview in Dashboards | XM Community
Skip to main content

Hello,
I'm using a little piece of html for display a preview of the files img uploaded by the survey respondants.
I put this code in a embedded data like that

I was thinking, is there a way to open the img in a new window with personalise size ? (Like a "popup"). I looked around and it seems that need JS or CSS, and it's not possible here.
What do you think ?

Hi JR33,
You will absolutely need JS to do this, it's impossible to make the browser do anything without it.
There is a short guide on adding code to your questions here.
If you want a button to trigger the popup, simply add a Text/Graphic question and add some HTML:

Then you can add JavaScript to the question which tells the button to open a popup:
//bind a popup function to to the button
jQuery("#mybutton").click(function () {
let params = `width=600,height=600`;   //set these to whatever you want
open("${q://QID8/UploadedFileLink}", 'Image Popup', params);
});
Depending on your user's browser settings it might automatically block the popup - so you may need to instruct users on disabling any popup blockers they may have.
Good luck!


Yes you totally right but I didn't wanna open a new windows in a survey, but in a dashboard.
So it's truly impossible. That what I thinked about 😪


Leave a Reply