Contact Type not getting set through portal

gazalagrawa
Tera Contributor

Requirement is if a case is created through portal the contact type should be set as portal, if created through email the type should be set as Email.

 

For Email it is working fine, we are setting through Email 2 case flow

 

But through portal it is set as None, None is default on case form

 

I am setting through record producer but the code is not reflecting

4 REPLIES 4

Ankur Bawiskar
Tera Patron

@gazalagrawa 

code from record producer should work

share your script and config screenshots

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

Naveen20
ServiceNow Employee
Most likely cause: the value being assigned isn't a valid choice on sn_customerservice_case.contact_type, so the form renders it as --None--. Out of the box this field does not ship a "Portal" choice — typical values are along the lines of phone, email, web, chat, social (verify in your instance, as choices vary by release/plugin).

Try - Fix:

1. Confirm the choice exists. Go to System Definition > Choice Lists, filter table = sn_customerservice_case, element = contact_type. If there is no portal choice, add one with Value = portal (lowercase, no spaces) and Label = Portal — or reuse an existing value like web.
2. In the record producer's Script field, set the stored value (not the label):

current.contact_type = 'portal';

3. Check that no business rule on sn_customerservice_case (insert/before) is overwriting contact_type after the producer runs.

Quick test: open the created case in a list view to see the raw stored value — if it's blank, the choice doesn't match.

Tanushree Maiti
Mega Patron

Hi @gazalagrawa 

 

Open your Record Producer in ServiceNow and

navigate to the Script section.

Add the following line at the top of your  producer script to target the contact type field

 

current.contact_type = 'portal';

 

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

AndersBGS
Tera Patron

Hi @gazalagrawa 

 

@please share your code from the record producer. By doing this, it will much easier to help you.

 

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/