How to visit url programmatically?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2023 06:41 AM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2023 06:43 AM
Hi @ican
1st , do you want to do this in ServiceNow?
2. If yes, then what is the use case for this?
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
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/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2023 07:18 AM
Use case:
Table
ID | Name | URL |
001 | Sample | www.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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2023 06:44 AM
Hello @ican
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