Is there a way to auto-populate a variable from one catalog item to another when open by manager.

Brian Dean
Tera Expert

Team, 

Is there a way to pull the terminated username variable (requested_for) from one catalog item to another when the manager opens the link from the email notification?

The 3rd screenshot is the second catalog item where I am trying to have this user (SNOW-TEST) be auto-populate. 

I have tried both links to pull that but it did not work. 

https://bessemertrustdev.service-now.com/sp?id=sc_cat_item&sys_id=d5d5691c1b91ed90098331901a4bcbc8&r...

 

https://bessemertrustdev.service-now.com/sp?id=sc_cat_item&sys_id=d5d5691c1b91ed90098331901a4bcbc8&r...}

 

BrianDean_0-1701893954419.png

 

BrianDean_1-1701894008137.png

 

 

 

 

 

 

3 REPLIES 3

SanjivMeher
Kilo Patron
Kilo Patron

You can use an onLoad script for this. Below are few examples.

https://www.servicenow.com/community/developer-forum/not-able-retrieve-url-parameters-through-onload...

https://www.servicenow.com/community/developer-blog/3-ways-to-populate-values-in-servicenow-via-the-...

 


Please mark this response as correct or helpful if it assisted you with your question.

SanjivMeher
Kilo Patron
Kilo Patron

Also I would suggest hide your instance URL from you post.


Please mark this response as correct or helpful if it assisted you with your question.

DanielCordick
Mega Patron
Mega Patron

Something like this in an onLoad client script should work 

 

function getParameterValue(name) {
        var url = top.location.href;
        var value = new URLSearchParams(url).get(name);
        if (value) {
            return value;
        }
        if (!value) {
            var gUrl = new GlideURL();
            gUrl.setFromCurrent();
            value = gUrl.getParam("sysparm_id");
            return value;
        }
    }

 

grabbed the script form here for reference

 

https://www.servicenow.com/community/csm-forum/get-url-parameters-from-client-script/m-p/389334

 

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response helped in any way