How to download in a script USED BY info on the database? | Community
Skip to main content
New Participant
September 10, 2021
Solved

How to download in a script USED BY info on the database?

  • September 10, 2021
  • 3 replies
  • 3895 views

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

 
 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman
Like Floyd says, there’s no (REST) API to fetch these dependent assets.

Are you trying to fetch them for all fields, or just for the currently highlighted field?

3 replies

Thorsten
New Participant
September 14, 2021

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.

ivanherAuthor
New Participant
September 20, 2021

Hello, thanks for this i will use it, i really appreciate it!

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
September 12, 2021
Like Floyd says, there’s no (REST) API to fetch these dependent assets.

Are you trying to fetch them for all fields, or just for the currently highlighted field?
ivanherAuthor
New Participant
September 13, 2021

Thank you! well the goal was to download it that way, so i guess i got my answer, thank you!

Employee
September 12, 2021

@ivanher 

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.