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.

Hi i am calling script include from client but it was showing "type" error in my code please give me

aswini bc
Tera Contributor

aswinibc_0-1761982654266.png

 

9 REPLIES 9

lpruit2
Kilo Sage

Greetings,

 

I believe the issue is that it is expecting a comma at the end of your function. Can you try adding a comma after the ending bracket in line 11? 

Before:
}
type:

After:
},
type:



Ankur Bawiskar
Tera Patron
Tera Patron

@aswini bc 

your script include syntax is wrong.

Please correct that by following ServiceNow Docs

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

And if it helps, here is a link to some of that ServiceNow documentation which will discuss syntax and provide good examples. 

Script includes

GlideFather
Tera Patron

Hi @aswini bc 

 

wirte a comma "," in the line 11.

 

From

}

 

To

},

 

And let me know if that helped

 

EDIT: look at some of the OOTB script includes:

GlideFather_0-1762026020919.png

 

EDIT2: your return is not well formatted either. There will be no spaces.

 

return gr.email + "&" + gr.first_name + "&" + gr.last_name;

it will look like this:

return example@test.com&FirstName&LastName

 So better to do it like this:

return gr.email + " & " + gr.first_name + " & " + gr.last_name;

//or even better
var userDetails = gr.email + " & " + gr.first_name + " & " + gr.last_name;
return userDetails;

 

_____
This reply is 100 % GlideFather and 0 % AI