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.

ServiceNow & MS Teams Integration - Issue

Sairam3697
Tera Contributor

Hi Everyone , 

 

When I click on 'Collaborate' and then on 'Import Microsoft teams Chat' , I have 2 options to manually import the chat.

1. Related to this record

2. List all conversations

 

I have to make the field default to 'related to this record' and make it read-only so that users wont be able to click on 'list all conversations'. 

Sairam3697_0-1765188099791.png

 

1 REPLY 1

pavani_paluri
Tera Guru
Tera Guru

Hi @Sairam3697 ,

 

In classic UI and Service Portal, you can use UI Policies or Client Scripts to set a default and make a field read‑only.
In Workspace (Agent Workspace / CSM Workspace), those scripts don’t always apply because Workspace uses its own framework.

1. Set the default value
Go to the field dictionary for the “Import Microsoft Teams Chat” option.
Set the default value to “Related to this record.”
This ensures Workspace loads with that choice pre‑selected.

2. Make the field read‑only in Workspace
Use a Workspace Client Script (different from classic client scripts).
Create a new onLoad Workspace Client Script for the form.
Example:
function onLoad(form) {
form.setReadOnly('import_option', true);

*(Replace `import_option` with the actual field name.)*

3.Test in Workspace
Open the record in Workspace.
When you click Collaborate → Import Microsoft Teams Chat, the option should already be set to "Related to this record" and locked.

 

Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Pavani P