Forum Discussion

brian_s's avatar
brian_s
Qrew Trainee
7 days ago

Copying data from a table to a seperate table on save/update

If I have a form that I am having a user fill out, what is the best way to copy that data (or specific fields) from that form to a new table?

The form is for an approval and could be an "update" or a "new process" that needs to be approved. I'd like to copy all the requested updates to one table and the new requests to a separate table.  Ideally, I'd like to send updates over from the main form as well  (pending to approved/rejected, date modified, etc). 

I believe I could use a pipeline. Is that my best bet? and if so, is anyone aware of any decent posts that would provide a little guidance?

  • Yes, you can use a pipeline but a far better solution is to reconsider your approach.

    The best practice here is really to have a status field on the record and then have different reports and different notifications and subscriptions based on that status field. You will likely regret it in the end if you start making Duplicate tables. For example, if you decide to add a field to your form in one table, then you are going to need to add that field into other tables and keep the forms consistent.

    • brian_s's avatar
      brian_s
      Qrew Trainee

      Thanks Mark

      I do understand your point, but in a sense, I am looking to save it almost like an audit table.  You are correct, if we do make a change to the primary form, we may need to change a field on one or both of the "audit" tables, but I am looking to protect against if we needed to make significant changes to the table/form. At that point, the records in the audit table would technically be frozen as they were at the time they were approved.   This is a small form/table so maybe it's not worth it here. If we were to make a significant change, maybe a new app might make sense. 

  • There are techniques which work well when you have a limited number of fields to track to record an Audit Trail of every field changed. So to record the old value and the new value and who made the change and if course the date time stamp. 

    That can be shown in the form so the history is all conveniently all visible without needing to flip back and forth between records in different tables.