Pre-populate Interaction Form on the Agent Workspace

akhileshkumar
Tera Contributor

Hi,

I am looking to integrate Contact Center with ServiceNow and open up Agent Workspace.

As part of it, I am opening up a new interaction record and intend to pre-populate some fields on the interaction e.g. Opened For.

Is there a way to pass the information via the URL to Agent Workspace Interaction form  or Is there any other way?

 

1 ACCEPTED SOLUTION

Arsh2
Tera Guru

Hi Akhilesh,

Yes you can pass params through URL to create interaction records in Agent workspace. please see below

 

syntax would be like this:

/workspace/agent/new_record/interaction/-1/params/query/short_description=test

/interaction/                      -  defines your table name
/-1/                                    -  tells servicenow that you are creating a new record in the table
/params/query/                - this is the parameter where you will set your values from here
/short_description=test    - Define your fieldname equals to the value you want to set

 

Try the below example in your instance:

https://your-instance.service-now.com/now/workspace/agent/new_record/interaction/-1/params/query/short_description=test

 

Cheers,

Arsh

find_real_file.png

 

View solution in original post

14 REPLIES 14

I'm in a UI action trying to set this params, but nothing is showing up in my URL.  What is the syntax?  I'm using:

params = {};

params.sysparm_name = 'text';

Very helpful! But I think the number parameter (in your example -1) is not for the sys-id but the tab number in Agent Workspace.

Tested in Paris: 

  1. If I open the link with -1 twice in a row, I get a white page.
  2. If I change the number to a positive value (e.g. 5) then it opens the form in a new Agent Workspace Tab, resp. updates the existing Workspace Tab having this ID Example:
    1. First Call:  /workspace/agent/new_record/interaction/3/params/query/short_description=test
      --> Opens new Tab with ID "3" showing "Create Interaction" form with Short Description = Test
    2. Second Call call /workspace/agent/new_record/interaction/5/params/query/short_description=test --> Opens new Tab with ID "5" showing "Create Interaction" form with Short Description = Test
    3. Third call /workspace/agent/new_record/interaction/3/params/query/short_description=HelloWorld --> Reloads the tab from first call (with ID 3) with ID "3" showing "Create Interaction" form with Short Description = HelloWorld



Is there a way to ensure that it is always going to a new tab?

Hi Niclas,

Did you ever find a solution to always go to a new tab?

BR

Marcus.

akhileshkumar
Tera Contributor

Thank you for the reply. It was very helpful, I am able to populate the fields.

I'll post another query related to it.

Is there a way to parse the URL parameters on Agent Workspace passed since I am getting email as part of the Opened For parameter ?

I understand that GlideURL API does not work on the Agent Workspace.

Unfortunately there is no straight answer to parse URL in Agent workspace. Although it can be achieved to some extent with script includes but it depends on your companies requirement. 

If your issue is just regarding the email which is being triggered based on "Opened For" parameter - can you not write a simple client script to either copy the requested by field over to opened for field or set a dynamic value based on the URL function you are passing ?

Hopefully servicenow will come up with a better solution to parse it in AW soon in their next releases.

Cheers,

Arsh 

find_real_file.png