Hello Qualtrics users…
Did you ever want to export all the fields in a dashboard dataset into excel or the likes to save time having to copy and paste them all across form eg. a spec file you are creating?
Well I’ve just spent a few minutes trying to figure this out myself and with the aid of my support team (ie. chatGPT), I’ve produced below a script that will run in Chrome’s browser developer tool console window (maybe Edge too) and will copy into the clipboard the dataset as per what you see (ie the number of sources, rows etc). It will also handle Measure or Generic or Drill Down groups too, just make sure they are expanded first. So if you want everything copied, just enter the number of sources you have and all the rows (mine quite easily get over 800!) and then run the script. Please read the note about Excel as although Excel tries to be clever / helpful when you paste the text, it sometimes splits the data incorrectly which is down to the Text to Columns delimiter setting!
Hope this helps (give me a few likes it it helps - it certainly saved me some time getting it all into to excel!!) :)
Please note that if Qualtrics engineers change the structure of the dashboard dataset website, this code may not work so there is no guarantee that this will work as of today (but probably relatively easy to fix!).
(() => {
const DELIM = "|";
const clean = (v) =>
(v ?? "")
.replace(/\s+/g, " ")
.trim();
const text = el => clean(el ? el.innerText : "");
const sourceHeaders = [...document.querySelectorAll(".source-label-container")]
.map(e => text(e));
const rows = [];
rows.push([
"Field Type",
"Destination Field",
...sourceHeaders
]);
function processLi(li) {
const own = li.querySelector(":scope > dnd-nodrag > div, :scope > div");
if (!own) return;
const type = text(own.querySelector(".type-text"));
const destination =
text(own.querySelector("field-name > div")) ||
text(own.querySelector(".no-input"));
const sources = [...own.querySelectorAll(":scope .sources-side-row")]
.map(sr => {
const mapped = sr.querySelector(".source-field-name .ng-binding");
if (mapped) return text(mapped);
if (sr.innerText.includes("Not mapped"))
return "Not mapped";
return "";
});
rows.push([
type,
destination,
...sources
]);
if (["Measure Group", "Generic Group", "Drill Down"].includes(type)) {
const childLis = li.querySelectorAll(":scope > dnd-nodrag > div > ul > li, :scope > ul > li");
childLis.forEach(processLi);
}
}
document.querySelectorAll("#grid-body > ul > li")
.forEach(processLi);
const maxCols = Math.max(...rows.map(r => r.length));
const output = rows
.map(r =>
[...r, ...Array(maxCols - r.length).fill("")]
.map(clean)
.join(DELIM)
)
.join("\n");
// Copy ONLY the data (no notes mixed in)
if (typeof copy === "function") {
copy(output);
}
console.clear();
console.log(`Copied ${rows.length - 1} rows using delimiter "${DELIM}"`);
console.log(`
================ IMPORTANT EXCEL NOTE ================
Qualtrics Dashboard Dataset has been copied into the
clipboard ready for pasting into excel
Warning. The auto parsing in excel may need reseting
if when pasting it is splitting into the incorrect
number of columns. To Reset the auto parsing, follow
these step:
1. In Excel go to: Data → Text to Columns
2. Choose: Delimited → Next
3. UNCHECK all delimiters (Tab, Comma, Space, etc.)
4. Click Finish
This resets Excel’s cached paste parsing rules.
======================================================
`);
})();
