Discussions

Expand all | Collapse all

is it possible to create a quick base action or a automation for the creating the history record

  • 1.  is it possible to create a quick base action or a automation for the creating the history record

    Posted 06-20-2018 03:29
    Considering my situation,

    I have two tables parent and child and there exists a relationship between them

    the records in the parent table are 

    Record_id           name            school
    1                         AA                   X
    2                         BB                    Y

    The records in the child table are 

    Record_id    parent_id          mark 1           mark2 
    1                        1                   70                  80
    2                        1                    85                  89
    3                        2                    90                  98
    4                        2                     91                  92


    Right now if I change any value in parent or child table, i need to create a record in the history table, which has all the columns of parent and child with the old value

    If suppose i change the value of mark 2 of child record id --> 1 from 80 to 100 in the child table

    The records in the child table are 

    Record_id    parent_id          mark 1           mark2 
    1                        1                   70                  100 (changed from 80 to 100)
    2                        1                    85                  89
    3                        2                    90                  98
    4                        2                     91                  92

    I need a new entry in the history table like below

    name        mark1    mark2      child_record_id              parent_id      school
    AA             70          80            1                                      1                       X


    Can you please help in this situation.... I m new to quickbase , of possible .. can you please explain in brief.

    Thanks
    Pushpakumar


  • 2.  RE: is it possible to create a quick base action or a automation for the creating the history record

    Posted 06-21-2018 14:54
    Hi .. can someone help me on this?

    Thanks


  • 3.  RE: is it possible to create a quick base action or a automation for the creating the history record

    Posted 06-21-2018 16:13
    Hi Pushpakumar,

    It is possible to use an automation or action to help you to track field changes and edits. This can be done by setting up an Action to copy over data from your existing table and have it create a new record for each edit in an Audit table. For example if I wanted to audit my projects table for every time a status is changed and I wanted to capture the changed status, the former status, the user who edited it, and when. 

    I would create a Project Status Audit table with a field for Status after edit, Status before edit, user who edited, date of edit, Project Name, and Record ID. Then I would create an Action on the table I wish to audit from and set it to fire whenever a Project is added or modified and the Project Status changes. Then I select the option to Add a record and select my new Audit table. From there I can choose to write over values from one field to another, and make use of the option to write the old value from the Status field to the Status before edit field and then the value after edit to the Status after edit field. This will give me a nice audit record to track my changes. Then I could set it up to capture the Date Modified and Last Modified By fields into my user and date field I created.

    The key is just to have a place to copy over your data and build the action to fire off the field you are capturing. I hope this information is helpful Pushpakumar.