Auto populating phone number
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 03:30 AM
Hi folks ,
I have a requirement in catalog item. In that i have 2 variables 1. requested for 2 . phone number
based on the request below points need to be executed
- If user's has only one Phone Numbers, then the Phone Number should be auto populated.
- If user's have multiple Phone Numbers, then the user should be presented with the drop-down/reference list to select the Phone Number.
How i can achieve this?
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 04:32 AM
Hi,
You have to create a two field, one is a String field if single phone number, and other is a dropdown when multiple phone numbers.
You need to Create an On Load CS and use GlideAjax to check the Phone number, if single phone show only string field and populate it via object returned by Ajax, if it is multiple phone numbers hide the String field and show Dropdown field populating multiple numbers.
Regards,
Piyush Sain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 05:49 AM
Hi, I believe you can use g_form.getReference() function and achieve this requirement. Refer below link to understand the usage and how to apply in the code.
https://servicenowguru.com/scripting/client-scripts-scripting/gform-getreference-callback/
Suresh.