Skip to main content
November 30, 2021
Question

How to audit record in Audit table

  • November 30, 2021
  • 5 replies
  • 0 views

Hi,

I have a CDT and it is linked to a form and fileds are linked to CDT columns.

Now, when user submit the form, data should save in the main table as well as another Audit table.

Any idea how can I achieve this requirement.

5 replies

acaciob0002
November 30, 2021

Hi there,

You can try to add triggers to your audit table.

Regards,

Acacio B

November 30, 2021

This I can do at database end.

But, I would like to know if there is any mechanism to copy source CDT field values to the destination CDT Audit fields and call Write to Data Store Entity.

November 30, 2021

Hi,

Trigger is the best option.

But, if you need to execute this in Appian, then create an expression rule.

a!forEach(

items: ri!sourceCDT,

expression type!targetCDT(

param1: fv!item.value1

param2: fv!item.value2

)

Regards,

Farnaz

stewart.burchell
December 1, 2021

Hi Hari

There are a few things to consider here:

  • what is the audit requirement? there are different levels of "audit":
    • simple: who changed the data and when
    • event based audit to a separate table - who did what and when
    • field-level audit - what did the whole data look like before a change and what does it look like now
  • you also need to consider who will want to view that audit, when and how - it's all very well to use trigger-based copies of the data but if you can't surface that to a specific role in a timely and easy-to-understand format then the functionality doesn't meet the requirements 
  • each of the above levels of sophistication requires different solutions, both to record the changes and also to present them