When to use Write to Data Store Entity Smart Service and expression function a!writeToDataStoreEntity()

Hello everyone, my team and I are currently exploring writing our data into the database however, we are unsure if we should make use of the process model to write to db or the expression rule function a!writeToDataStoreEntity() provided by Appian. We read up the documentation but it doesnt really highlight the major differences or the preferred scenario to use either one of the methods. One major difference that we thought of is that if we make use of the smart service in the process model, a process instance will be created upon runtime which will essentially help us to track and debug in case any error occur. Does anyone know what are the differences and when is preferred use one over the other? 

  Discussion posts and replies are publicly visible

Parents
  • I think the main way to decide is based on which type of interface you are using. For example, a task will always require using a process model, so it makes sense to perform the write to data store entity in the process model. However, if you want to write to the database from a report (for example, to save a filter value https://docs.appian.com/suite/help/latest/recipe-save-a-users-report-filters-to-data-store-entity.html), this is easier to use the smart service function because reports don't use a process model. So the rule of thumb to use is: if a process model is required by the type of interface you use (action / task forms), use the smart service in the PM; if the interface does not require a process (record / report dashboards), then use the smart service function.

    I think you will also find that most cases when you are saving data to the database involve using forms / processes because you will want to save to a database for completion, which means you will end up using the process model smart service quite a bit more often.

Reply
  • I think the main way to decide is based on which type of interface you are using. For example, a task will always require using a process model, so it makes sense to perform the write to data store entity in the process model. However, if you want to write to the database from a report (for example, to save a filter value https://docs.appian.com/suite/help/latest/recipe-save-a-users-report-filters-to-data-store-entity.html), this is easier to use the smart service function because reports don't use a process model. So the rule of thumb to use is: if a process model is required by the type of interface you use (action / task forms), use the smart service in the PM; if the interface does not require a process (record / report dashboards), then use the smart service function.

    I think you will also find that most cases when you are saving data to the database involve using forms / processes because you will want to save to a database for completion, which means you will end up using the process model smart service quite a bit more often.

Children