cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Dear Experts,

I have an entity with a string field called "defaultValue".

entity PropertiesTest : cuid { 
    defaultValue : String(1000); 
}

If in this field I put string "true" or "false", the value is interpreted as boolean and is converted to "1" and "0".

Data are inserted by csv file. I have tried also with quotation marks.

ID;defaultValue
bc1c3c82-6ade-11eb-9439-0242ac130002;true
773a6a34-6adf-11eb-9439-0242ac130002;false
7b96940e-6adf-11eb-9439-0242ac130002;alice test
7b96940e-6adf-11eb-9439-0242ac130005;'false'
7b96940e-6adf-11eb-9439-0242ac130006;"false" 

If I try by OData, the string is correctly inserted.

HTTP/1.1 200 OK
{
  "d": {
    "ID": "773a6a34-6adf-11eb-9439-0242ac130002",
    "defaultValue": "false",
    "__metadata": {
      "type": "WTest.PropertiesTest",
    }
  }
}

We have solved using a workaround but maybe it should be fixed.

Best.

Accepted Solutions (0)

Answers (1)

Answers (1)

steffenwaldmann
Product and Topic Expert
Product and Topic Expert

Hi Alice,

Good news, we shipped a fix for this issue in the most recent @sap/cds release (5.9.0). The SQLite CSV importer will now interpret quoted "true" and "false" as strings instead of Booleans.

Best regards,

Steffen