Getting Current Record Value from Workflow when type is list collector

kylekaplan
Kilo Explorer

Hi, So I am have a form and when they submit the form it creates a record and kicks off my workflow. I have a script where I get the values they entered by current.name

i.e. current.first_name will return the name they entered into the form for that field.

One of the fields is of type list collector. So as they type it connects to a table and gives options for them to select from, but when I do current.list_collector_name it returns a long random string. i.e. 07c37bb06f75a54032f6792f8e3ee4b7

Any ideas as to why this is happening and how I get the value the user selected?

Thank you.

1 ACCEPTED SOLUTION

Not applicable

That's a sys_id.



Try 'current.list_collector_name.getDisplayValue()'



Tim


View solution in original post

4 REPLIES 4

Not applicable

That's a sys_id.



Try 'current.list_collector_name.getDisplayValue()'



Tim


snowenthusiast
Tera Contributor

Hi kylekaplan,



Its not a random string but a GUID (sys_id) which points to the record to which your list collector is referencing. List collector is a data type where you can select multiple values, so as users select more values you'll get CSV of sys_id's i.e. something like: 07c37bb06f75a54032f6792f8e3ee4b7,07c37bb06f75a54032f6792f8e3ee4b7,07c37bb06f75a54032f6792f8e3ee4b7. If you want to get the display values, please go ahead as suggested by Tim. Else, you'll have to separate out the sys_id's through current.list_collector_name.split(",") and push the individual ID's wherever required.



Hope this helps.


antin_s
ServiceNow Employee

Hi Kyle,



The below statement will give you the output you want.



current.list_collector_name.getHTMLValue();



Hope this helps. Mark the answer as correct/helpful based on impact.



Thanks


Antin


kylekaplan
Kilo Explorer

Thanks everyone. All the answers helped. I marked Tim's answer because it was first and what I went with.