Support

Expand all | Collapse all

get multi-select items as list in velocity

  • 1.  get multi-select items as list in velocity

    Posted 12-20-2019 11:20
    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
    ------------------------------


  • 2.  RE: get multi-select items as list in velocity

    Posted 12-27-2019 07:08

    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
    ------------------------------



  • 3.  RE: get multi-select items as list in velocity

    Posted 01-02-2020 10:34
    Happy Holidays!

    Can we file a bug ticket to address the information loss here?

    In the meantime I can try to work around the issue, but we currently have around 200 picklists, so ensuring none of them use any commas in any of their options is not really a robust / sustainable solution. (I'm not aware of any of our picklist options that require commas, but there is no way to enforce the limitation, which can lead to silent errors -- the worst kind)

    Thanks,
    -Rafael

    ------------------------------
    Rafael Medina
    ON Semiconductor
    ------------------------------