Imports Not appearing in Data Store

Hello,

When I import either a csv or excel file. the records do not appear on the data store. 

I do not have access to view the database but the files make it to the target folder.

Thank you for the help

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Is there an error in the process? Did you check the logs for more details?

  • Hello Mathieu,

    When I use the Import Excel To Database smart service, I do not get an error and I am unable to access the system logs.

    When I to use the readexcelsheetpaging() function, I am able to view the data in the Expression Test Output (RAW).

    When I to try write the data to a CDT, I get a CastInvalid error. I am really not sure what else to try here.

    Expression

    a!writeToDataStoreEntity(
    dataStoreEntity: 'recordType!{5d8ec9f2-52c8-4946-a0e8-9ae5ed74aac5}AIC Demographic',
    valueToStore: fn!readexcelsheetpaging(
    excelDocument: ri!importdata,
    sheetNumber: 0,
    pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: 1000,
    )
    ),
    )

    Test Output Error

    Expression evaluation error at function a!writeToDataStoreEntity: Could not cast from RecordType to Data Store Entity. Details: CastInvalidCould not cast from RecordType to Data Store Entity. Details: CastInvalid

  • 0
    Certified Lead Developer
    in reply to Kerlin

    The error message you see is pretty much self explaining. You try to pass a record type to the datStoreEntity parameter. That will not work. A constant pointing to that entity in the data store would be a better fit.

    Now, without access to the database or log files this will become a tough job.

    Can you share a bit more details about what you exactly tried before and what you observed when trying?

  • Thanks for the reply Stefan.

    My goal is to read (or import/upload) either a .xlsx or .csv file to a staging table then after processing the data (type conversions etc.) store the data into a CDT.

    So far I have used both the  'Import Excel to Database' and 'Import CSV to Database" smart services from the Excel Tools plugin. I am able to successfully run the process but data doesn't appear in the database (without errors).

    When I use the readexcelsheetpaging(), I am able to view the data with a DataSubset data type.

    Are able to explain why  constant pointing to that entity in the data store would be a better fit? 

    a!writeToDataStoreEntity(
    dataStoreEntity: cons!AIC_Demographic_DSE,
    valueToStore: fn!readexcelsheetpaging(
    excelDocument: ri!importdata,
    sheetNumber: 0,
    pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: 1000,
    )
    ),
    )

    What I wrote here returned, Reaction Tree

  • 0
    Certified Lead Developer
    in reply to Kerlin

    Well, the parameter name and type is "dataStoreEntity" and not "recordType".

    And, you can use the function a!writeToDataStoreEntity() only inside a saveInto parameter of a UI component.

    Question: Are you aware of the differences data store entities vs. records types?

    How do you check whether there is data imported without access to the DB?

  • Understood.

    I must not be aware of the differences. My understanding is the record type is where I define my data (the imported excel file) and the data store entity is where the data is stored (the excel worksheets).

    I check whether the data imported from the record type

    Are you able to write an example expression using the a!writeToDataStoreEntity() function in the saveInto parameter?

    Would this work? or should I move a!writeToDataStoreEntity() to the button?

    a!formLayout(
    label: "Form",
    contents: {
    a!fileUploadField(
    label: "File Upload",
    labelPosition: "ABOVE",
    value: ri!importdata,
    target: cons!AIC_target_folder,
    saveInto: {a!writeToDataStoreEntity(
    dataStoreEntity: cons!AIC_Demographic_DSE,
    valueToStore: fn!readexcelsheetpaging(
    excelDocument: ri!importdata,
    sheetNumber: 0,
    pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: 1000,
    )
    ),
    )},
    validations: {}
    )
    },
    buttons: a!buttonLayout(
    primaryButtons: {
    a!buttonWidget(
    label: "Submit",
    submit: true,
    style: "PRIMARY"
    )
    },
    secondaryButtons: {
    a!buttonWidget(
    label: "Cancel",
    value: true,
    saveInto: ri!cancel,
    submit: true,
    style: "NORMAL",
    validate: false
    )
    }
    )
    )

Reply
  • Understood.

    I must not be aware of the differences. My understanding is the record type is where I define my data (the imported excel file) and the data store entity is where the data is stored (the excel worksheets).

    I check whether the data imported from the record type

    Are you able to write an example expression using the a!writeToDataStoreEntity() function in the saveInto parameter?

    Would this work? or should I move a!writeToDataStoreEntity() to the button?

    a!formLayout(
    label: "Form",
    contents: {
    a!fileUploadField(
    label: "File Upload",
    labelPosition: "ABOVE",
    value: ri!importdata,
    target: cons!AIC_target_folder,
    saveInto: {a!writeToDataStoreEntity(
    dataStoreEntity: cons!AIC_Demographic_DSE,
    valueToStore: fn!readexcelsheetpaging(
    excelDocument: ri!importdata,
    sheetNumber: 0,
    pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: 1000,
    )
    ),
    )},
    validations: {}
    )
    },
    buttons: a!buttonLayout(
    primaryButtons: {
    a!buttonWidget(
    label: "Submit",
    submit: true,
    style: "PRIMARY"
    )
    },
    secondaryButtons: {
    a!buttonWidget(
    label: "Cancel",
    value: true,
    saveInto: ri!cancel,
    submit: true,
    style: "NORMAL",
    validate: false
    )
    }
    )
    )

Children