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.

Auto set contact type to Self Service when raising via Service Portal

kevwatson
Giga Contributor

Auto set contact type to Self-Service when raising via Create Incident record producer on the Service Portal?

 

1 ACCEPTED SOLUTION

Sam Ogden
Tera Guru

In the record producer script we have the following:

 

current.contact_type = 'self-service';

Thanks

View solution in original post

3 REPLIES 3

Sam Ogden
Tera Guru

In the record producer script we have the following:

 

current.contact_type = 'self-service';

Thanks

Thanks for the quick response, this worked and so did the other question you replied to.  Do you mind me asking how this script language work to help me going forward? For example if I wanted to set the Location field as the location set against the affected users record how would we do this?

Hi Kevwatson,

I'm pretty new to the record producers too.  This section in the docs shows

  • Create a variable on the record producer with the same name as the field in the target record. For example, a variable named caller_id on a Create a New Incident record producer populates the caller_id field on the new incident record. Use a variable type that corresponds to the field type.

You can define a script where the same name is not used, using the following process:

  • Use current.*FIELD_NAME* to reference fields on the record being created.
  • Use producer.*VARIABLE_NAME* to reference values entered by the end user.

https://docs.servicenow.com/bundle/jakarta-it-service-management/page/product/service-catalog-management/concept/c_PopulatingRecordData.html

 

This link is also handy to find user information.

https://www.servicenowguru.com/scripting/user-object-cheat-sheet/

 

Hope this helps