error when inputting to DB

I've posted a previous discussion but still no response, while I wait I am trying a different approach, im trying to input values into a writetodatastoreentity and i get this error:

Interface Definition: Expression evaluation error: An error occurred while executing a smart service: An error occurred while trying to write to the entity "cart" [id=7626554b-fee0-459d-b2d8-732f6e1bc7f5@3179, type=AS_Cart_DataBase (id=3784)] (data store: AS Data Store). Details: java.lang.IllegalArgumentException: The list of records to be saved must not be null or empty: TypedValue[it=3785,v={}] Data: TypedValue[it=3785,v={}]

I'm typing an a!save into the button saveinto I have 3 values and 2 0 like this: saveInto: a!writeToDataStoreEntity(cons!AS_DataStore_Cart_Pointer,{local!info.name,local!info.quantity,local!info.price,0,0}) am I doint something wrong?

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to pedrob0002

    Instead of giving values directly, set them by constructing the CDT using those values or use local variables or rule inputs of that CDT with those values. I am not sure what is the structure of your CDT, but for e.g. if there is an employee cdt with 3 fields (id, name, phone) you can use -

    a!writeToDataStoreEntity(
      dataStoreEntity: cons!EMPLOYEE_ENTITY,
    /* just start typing type!your_cdt_name and appian will provide list of cdt's to choose from for the type constructor */ valueToStore: type!<namepace><cdt_name>(id: 1, name: "abc", phone: "1234567890")
    )
Children