Hello
@Chloe,
we seem to find a solution to this with Rafael. I am enclosing code snippet in case anyone will face similar request.
#foreach($doc in $documentList)
#foreach($field in $documentSource.getItem($doc.document.getId()).getCustomFields())
#if($field.getFieldName() == "multiselect")
#foreach($value in $field.getFieldValues() )
$documentSource.getLookup($mathTool.toInteger($value)).getDataValue() <br/>
#end
#end
#end
#end
This will iterate over items and their fields and search for field with key "multiselect". For that it will get currently set data values as a a list and in case of Lookup (Pick List) those are of Lookup type.
Kind regards,
Roman
------------------------------
Roman Sickaruk
ON Semiconductor
roman.sickaruk@onsemi.com------------------------------
Original Message:
Sent: 12-27-2019 07:07
From: Chloe Elliott
Subject: get multi-select items as list in velocity
Rafael:
Hi, hope you are having a wonderful holiday season! So there are a few things here to consider, all of which are manual in nature and yes, are not officially in the documentation. Just some possible workarounds to try.
One, try not to use 'commas' in picklist items in general.
Two, If you need to, use a "low accent delimiter" (ˏ) instead of a comma in Picklist items. Use something like U+02CF - "ˏ" which looks just like a comma but isn't.
Or three, you could look over the items before you export and manually change anything that has a comma in it.
Best,
------------------------------
Chloe Elliott
Jama Software
Portland OR
Original Message:
Sent: 12-20-2019 14:20
From: Rafael Medina
Subject: get multi-select items as list in velocity
Hi,
Is there any way to get the selections of a multi-select field in a velocity report as a list of strings? Currently when you use the $velocityReportUtil.getValueForField function you get back a single string with commas between the selections. This is problematic, however, since the picklist items themselves may have commas, so you cannot simply split on "," to get a list of the selected items.
The testCaseSteps field has a similar issue/behavior when using getValueForField, but since it is a built-in special structure, you can also access it from the document object ($doc.testCaseSteps), and subsequently iterate over its line items (and separately access action / expectedResult / notes fields). There doesn't appear to be a similar way to access multi-select information, but the velocity documentation is so limited it may just be hard to find.
Thanks,
-Rafael
------------------------------
Rafael Medina
ON Semiconductor
------------------------------