- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2024 12:29 PM
Hello,
I have an existing onSubmit catalog client script that displays and mandates a variable on the Task.
This variable needs to be restricted to allow the KBXXXXXXX format.
I would like to include the following script into my onSubmit Catalog client script:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2024 01:48 PM
Hi,
Can you please elaborate on the issue you are experiencing?
Also, is it possible to use a reference type variable instead of a text type?
If so, you don't even need to have a client script to verify the input.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2024 01:56 PM
Hi @KS13,
I'm struggling to understand why you’re allowing a user to free type into this field and then check if it’s a valid Knowledge Article via a regex.
Unless I’m missing something here, I’d recommend making this variable a field type of ‘Reference’ pointing at the Knowledge table.
This will ensure only valid Knowledge records can be selected whilst also providing you the ability (if required) to restrict the articles displayed by data points applicable to the articles such as active articles only, or from certain Knowledge bases, or restricted by knowledge categories for example.
Please note. A field of type Reference caters for a singe selection only which is based on my assumption based on your script above.
If you would like a user to be able to select more than one Knowledge article, select a field type of List Collector / GlideList.
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2024 01:48 PM
Hi,
Can you please elaborate on the issue you are experiencing?
Also, is it possible to use a reference type variable instead of a text type?
If so, you don't even need to have a client script to verify the input.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2024 01:56 PM
Hi @KS13,
I'm struggling to understand why you’re allowing a user to free type into this field and then check if it’s a valid Knowledge Article via a regex.
Unless I’m missing something here, I’d recommend making this variable a field type of ‘Reference’ pointing at the Knowledge table.
This will ensure only valid Knowledge records can be selected whilst also providing you the ability (if required) to restrict the articles displayed by data points applicable to the articles such as active articles only, or from certain Knowledge bases, or restricted by knowledge categories for example.
Please note. A field of type Reference caters for a singe selection only which is based on my assumption based on your script above.
If you would like a user to be able to select more than one Knowledge article, select a field type of List Collector / GlideList.
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.
Thanks, Robbie