Can we use the "EMPTY" keyword to blank out a field that has a value when using GRLoader to update a Target CI?

Document ID : KB000018737
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

Per the documentation it is possible to use the parameter grloader.emptyvalue=EMPTY to set the EMPTY value to remove a value when it isno longer present. This does not work. Wrapping it in quotes, double quotes does not help to get grloader to move the EMPTY value from the spreadsheet or csv to the TWA table in the database.

However, If the EMPTY value is manually in the TWA database or through the TWA gui, the system works as expected.

Whenever using the configuration file parameter to set a value in a cell and load it to TWA, the column has a null value in the database field.

Solution:

When loading into TWA using GRLoader using a CSV file, an empty value will not get translated into the 'EMPTY' keyword.

The solution is to identify a string value that would never be used outside of being a keyword, for example: 'abcdefgh'.

Create two separate configuration files, one for loading into TWA and one for loading from TWA.

LTTWA.cfg
grloader.server=http://servername:8080
grloader.spinner=no
grloader.csv.escape=^
grloader.inputfile=Book1.csv

BOOK1.CSV has:
"name","family","class","system_name","serial_number","mac_address","tgt_id"
"lannister","Hardware.Server","server","lannister","stark","abcdefgh",
"lannister"

LFTWA.cfg
grloader.server=http://servername:8080
grloader.spinner=no
grloader.csv.escape=^
grloader.emptyvalue=abcdefgh
"abcdefgh" will get treated like the EMPTY keyword.

When running the grloader command to load from TWA:
grloader -N GRLoader_12.7 -cfg LFTWA.cfg -lftwa -u user -p password

It will now blank out the value in the mac_address column if there was a value there previously.