Export to CSV adding {Code} not present in the UI
search cancel

Export to CSV adding {Code} not present in the UI

book

Article ID: 431074

calendar_today

Updated On:

Products

Clarity PPM On Premise Clarity PPM SaaS

Issue/Introduction

We have some custom dynamic lookups in Clarity. Those lookups show the Investment Name and Code on the grid. When exporting it to CSV, one of the lookups appends the Investment Code in curly brackets. Why?

The lookup code of the affected field is the following:

SELECT @SELECT:INV.ID:ODF_PK@,
   @SELECT:INV.CODE:CODE@,
   @SELECT:INV.CODE:UNIQUE_CODE@,
   @SELECT:'['||CODE||'] '||' ['||NAME||']':NAME@
FROM ODF_CA_MY_THEMES THEMES
INNER JOIN INV_INVESTMENTS INV ON INV.ODF_OBJECT_CODE = 'my_themes' AND THEMES.ID = INV.ID
WHERE @FILTER@
@BROWSE-ONLY:
AND INV.IS_ACTIVE = 1
:BROWSE-ONLY@

This happens when the Export to CSV option is set to Export/Import

Environment

Amy Clarity supported release

Cause

This is by design:

If the dynamic look up has UNIQUE_CODE and the mode is set to '(mode=csv_import)", UNIQUE_CODE should be exported along with display labels.

Resolution

Modify the query and remove the UNIQUE_CODE if you do not want the extra {curly braces} to be exported

SELECT @SELECT:INV.ID:ODF_PK@,
   @SELECT:INV.CODE:CODE@,
   @SELECT:'['||CODE||'] '||' ['||NAME||']':NAME@
FROM ODF_CA_MY_THEMES THEMES
INNER JOIN INV_INVESTMENTS INV ON INV.ODF_OBJECT_CODE = 'my_themes' AND THEMES.ID = INV.ID
WHERE @FILTER@
@BROWSE-ONLY:
AND INV.IS_ACTIVE = 1
:BROWSE-ONLY@