For Service Catalog Support - Populating Select/Lookup Field
search cancel

For Service Catalog Support - Populating Select/Lookup Field

book

Article ID: 245022

calendar_today

Updated On:

Products

CA Service Desk Manager CA Service Catalog

Issue/Introduction

When you have a table where a field/column contains comma delimited string (e.g., 1,2,4,5,basement).

If you extract this from the table, is there a way to split this and populate the select/lookup field via JavaScript?

I tried this in the Report Builder, although it works if I run this query from the SQL Management Studio, it fails
in the Report Builder SQL Query.

SELECT 
     Split.a.value('.', 'VARCHAR(100)') AS Data  
 FROM  
 (
     SELECT   
         CAST ('<M>' + REPLACE(cast(description as NVARCHAR(MAX)), ',', '</M><M>') + '</M>' AS XML) AS Data  
     FROM  call_req
  where ref_num='7212'
 )  AS A CROSS APPLY Data.nodes('/M') AS Split(a)

Error received: The argument 1 of the XML data type method "nodes" must be a string literal.

The Description field in this example contains: 1,2,4,5,6,basement
Expected result is it would split this to multiple rows:
1
2
4
5
6
basement

 

 

Environment

Release : 17.3.x

Resolution

Service Catalog > Catalog > Forms > add > Form > right-click on form > Add > Select > right-click on Select > option > right-click on Option > rename > Save