Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
hi
how to create the datashape and its fields by giving the fields and its basetype in runtime based upon the data from csv file.
thanks
Hi @achitters have you already seen the CreateDataShape service available in the Resource EntityService, you'll have to map the column headers from csv to the fields that can be passed to the fields in this CreateDataShape()
the datashape is already created in runtime and unable to set the primary key and basetype of the field in runtime.
I believe that should be doable with the UpdateFieldDefinition() , eg.
DataShapes["DemoDS"].UpdateFieldDefinition({ name: "Field1" /* STRING */, description: undefined /* STRING */, type: INTEGER/* BASETYPENAME */, ordinal: undefined /* INTEGER */, primaryKey: true/* BOOLEAN */, dataShape: undefined /* DATASHAPENAME */ });