Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

How to visit url programmatically?

ChezAndrewI0898
Tera Contributor

I want to visit a website programmatically and get the URL.

Sample:

Visit this website: www.samplesite/12345

Upon visiting website it is possible that the URL will change to this: www.samplesite/12367

 

I want to get the changed website: www.samplesite/12367

 

Thanks in Advance!

3 REPLIES 3

Dr Atul G- LNG
Tera Patron

Hi @ChezAndrewI0898 

 

1st , do you want to do this in ServiceNow?

2. If yes, then what is the use case for this?

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************

Use case:

Table

IDNameURL
001Samplewww.sampleurl.com/001

 

In Transform Map, I need to visit that URL and check if the URL did not change.

If the URL changes, I need to get the new URL.

Changed URL: www.sampleurl.com/003

 

Then I need to update the ID to 003 for that record in Transform Map.

 

Thanks!

Samaksh Wani
Giga Sage

Hello @ChezAndrewI0898 

 

if (window.location.href === "https://www.samplesite/12345") {
    // Redirect the user to the new URL
    window.location.href = "https://www.samplesite/12367";
}

 

Plz mark my solution as Accept, If you find it helpful.

 

Regards,

Samaksh