Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to populate logged in user's account in Account variable and set issue type in a catalog item.

sreeshsurendran
Tera Guru

The requirement is to populate the Logged in user's 'Account' to the account variable and set the Issue type as 'Network' when user goes to the Product Catalog item.

 

Here's the code which I tried.

 

var url = document.URL.parseQuery();
 
if(url=="")
{
 
      g_form.setValue('account',g_user.account);
var issue = getParameterValue(url,'issue_type');
 
      if (issue) {
 
g_form.setValue('network', issue);
 
      }
}
 
}
 
 
function getParameterValue(url,name) {
 
      
 
      if (url[name]) {
 
              return decodeURI(url[name]);
 
      } else {
 
              return;

 

 

Thanks & Regards.

Sreesh Surendran

ServiceNow - CSM & Integrations

0 REPLIES 0