i would like to download in an script this items, is there a standard field in the api that i could use to download the info from FIELDS USED BY?
Thanks
Solved! Go to Solution.
From memory, I don't think there is an API that allows you to fetch the USED BY for fields.
There is a manual option to do it via the UI - but I assume that is not what you want.
Thank you! well the goal was to download it that way, so i guess i got my answer, thank you!
I was looking at a similar problem just the other day. I put together a script I can run in the F12 console that will give you that page's Used-By, incl. text and link (I manually copy&paste those into a speadsheet to send to users to go and remove dependencies afterwards).
You might have to play a bit with the parameters/filters I used to make it work for your case, and replace the URL with your Marketo location.
// Scrape "Used-By" from Marketo Fields Management
let urls = document.getElementsByTagName("a");
for (let i = 0; i < urls.length; i++) {
if (urls[i].getAttribute("href") != "#" && typeof urls[i].getAttribute("href") == "string") {
if (urls[i].getAttribute("href").length > 5 && urls[i].innerText != "None" && urls[i].innerText != "Change Type In Progress") {
console.log(urls[i].innerText + "," + "https://app-xxx.marketo.com/?meue&meueDataOnlyMode" + urls[i].getAttribute("href"));
}
}
}
See if that helps a bit.
Hello, thanks for this i will use it, i really appreciate it!
Unfortunately, this won’t find all the Used By entries because Marketo has an “overflow” feature after which the fields are not shown but there’s a link to an XLS. IMO that should actually be the goal — to launch the XLS downloader for all fields.
P.S. Also, this is tighter (but has the same limitation of only getting the non-overflow entries):
var truncatedFieldList = Array.from(document.querySelectorAll(".mktListField a"))
.filter( el => el.href != "#" && el.textContent.trim() )
.map( el => el.textContent.trim() + "," + el.href );
console.log(truncatedFieldList.join("\n"));
Will do Sir!
thanks