How to insert data from interface to table?

I'm new to Appian, i want to insert data to my table.

1. Created a CDT with elements for Leave Request(Employee Name, Email, LStartDate, LEndDate)
2. Created datasource and assigned CDT to it.
3. Created Form from scrach and added fields with rule input on it.

now i want to create data store entity smart service to insert my data from Form to table Leave Request.

how to create data store entity smart service and call on submit button clicked.

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to bhushanb0001

    Value to store has to be the same type as the CDT used to create the datastore.  You need to make a custom datatype with the values that you need, then input one of those as the valueToStore.

    ri!leaveRequest.employeeName, ri!leaveRequest.email, ri!leaveRequest.startDate, ri!leaveRequest.endDate

    then your database write is just a!writeToDataStoreEntity(datastoreEntity: cons!DATA_STORE_ENTITY, valueToStore: ri!leaveRequest

    )

    All the other fields are already inside the leaveRequest CDT.  It's got everything you need contained in one place.

    If you have a strong need to store the inputs in separate rule inputs, you could merge them all together at the end into a leaveRequest by using the type constructor as your value to store.  Honestly I agree that's most likely an extra unneeded step in this instance.

Children
No Data