- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2022 07:17 AM
Hello everyone,
We are using Virtual Agent and our Service Desk is outsourced, they use their Twilio in their environment (not integrated to our ServiceNow.
So, when someone in our Virtual Agent asks for live agent support, we decided to pass all necessary information through a URL, so within the VA, this is the script passing the data to their Twillio:
(function execute() {
var spanishLink = 'https://webchat.servicedeskURL.com/?tenant=iss_companyID_gen_es_rc&firstName=' + vaInputs.user.first_name + '&lastName=' + vaInputs.user.last_name + '&email=' + vaInputs.user.email + '&login=' + vaInputs.user.email + '&client=iss_companyID_gen_es_rc&chatId=chat&languageCode=es&countryCode=es';
return spanishLink;
})()
(I removed the confidential information from URL above)
This is working fine when a user has ONE first and ONE last name, like:
vaInputs.user.first_name: John
vaInputs.user.last_name: Doe
However, when they have compound names (either first or last), Virtual Agent shows BAD OUTPUT LINK.
Like, vaInputs.user.last_name = Double Doe.
I could not find anything in the logs, but noticed that after several troubleshoots.
I'll try to convince the company to standardize first and last name to contain only one name, but in the meantime, is there a way to pass more than one name in this variable: vaInputs.user.first_name?
Thanks in advance
Solved! Go to Solution.
- Labels:
-
Virtual Agent

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2022 09:25 PM
Ah oke clear what you mean with double name 🙂 I guess it could be that a name has multiple spaces?
You could replace the spaces. Have you tried that? Replacing the space with %20.
Something like:
vaInputs.user.first_name.replaceAll(' ', '%20')
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2022 08:04 AM
Hi there,
Could you give an example of what you are after?
"is there a way to pass more than one name in this variable: vaInputs.user.first_name?" This will be the first_name of the logged in user.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2022 08:21 AM
Hi Mark,
Yes, for example, using my user as example.
'https://webchat.servicedeskURL.com/?tenant=iss_companyID_gen_es_rc&firstName=' + vaInputs.user.first_name + '&lastName=' + vaInputs.user.last_name + '&email=' + vaInputs.user.email + '&login=' + vaInputs.user.email + '&client=iss_companyID_gen_es_rc&chatId=chat&languageCode=es&countryCode=es'
The URL above would be passed as:
'https://webchat.servicedeskURL.com/?tenant=iss_companyID_gen_es_rc&firstName='Luiz'&lastName='Lucena'&email='luiz.lucena@email.com'&login='luiz.lucena@email.com'&client=iss_companyID_gen_es_rc&chatId=chat&languageCode=es&countryCode=es'
However, if either the first or last name field contains more than one name, like "Jose Arturo" (first name field) and/or last name as "Diaz Dominguez", the URL is broken. I presume due the space in between the names.
Thanks,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2022 09:25 PM
Ah oke clear what you mean with double name 🙂 I guess it could be that a name has multiple spaces?
You could replace the spaces. Have you tried that? Replacing the space with %20.
Something like:
vaInputs.user.first_name.replaceAll(' ', '%20')
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2022 05:42 AM
Thanks, Mark!
That did the trick!