Use cases of stored procedure and views in Appian

Certified Senior Developer

Hello,

In which case will use views and stored procedures in Appian ?

I know the basics about it but I am not sure when will use stored procedure and views.

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    I use stored procedures for large volume data transformations and try to avoid them as possible. I do not consider them as being low-code.

    With synced records and custom record fields, most use cases for views have vanished. When exporting to Excel, you might need a view for data transformations during export.

    That's my two cents, let's see what the others can tell us.

  • I think for the views, Appian's plan to completely deprecate using them as they enhance their records more and more. So if you're starting fresh, avoid using views. Instead, use the record relationships. 

    For the stored procedures, below are some use-cases.

    1. To get data from many tables at once. 
    2. To perform complex DB calculations, it is advised to do it on the DB level and keep the Appian side light
  • 0
    Certified Senior Developer

    Hi, I have used stored proc in many scenarios.

    Below are some use case which I have used

    1. In one of my projects we had hierarchy chart to maintain. End user would move child node from one parent node to another and this action used to involve lot of db changes, like manager mapping, cost center changes , nodes remapping, and then again deactivating old mapped nodes. So here we had used stored procs.

    2. In another project we had data coming from another system using integration and we would update 6 to 7 tables and in this case   some tables would needed to be updated and some would be refreshed entirely so here we had used procs.

    So main idea here is to use stored procs when you have to deal with complex and large db manipulation and changes.

    For views , as others have already suggested that you can use records and relationships ,so these days we can easily avoid for creating views normally. But in some cases where you have to format particular value ,like if you have stored some sort of lookup IDs in your table and you need to change this into lookup values for export functionality then you can consider creating views.

  • 0
    Certified Lead Developer

    There are very few applications that I have not used a stored procedure on. Stored procedures are a great way to offload some of the heavy lifting from Appian to the DB. Some common use cases are

    1. uploading a SQL/CSV file. Instead of putting all that data into memory, use the import to DB to get that data into a staging table, then use a stored proc to validate, manipulate, and split it into multiple tables and even write to a log file.
    2. heavy calculations that need to keep looping, pulling more data, etc.
    3. large data transformations or moves (even moving data to a history table)
    ... I could go on

    For views, again I always use them. Let the database transform the data before it gets pulled in. This way Appian is spending time on the execution and not then too much on transformation so that you do not hit timeouts or so that users are not waiting too long for a screen to render.