Forum Discussion

MuraliGangineni's avatar
MuraliGangineni
Qrew Cadet
6 years ago

How to automatically Copy records from Table1 to Table2 after applying filter on Table1.

 Automatically Copy records from Table1 to Table2 after applying filter on Table1. 
Table1 and Table2 dont have any relation.

28 Replies

    • MuraliGangineni's avatar
      MuraliGangineni
      Qrew Cadet
      I want the trigger to be on click of a button. On clicking the button, delete all the records from the Table2 and copy the records from Table1 to Table2. Before copying, filter has to be applied on "Article Number" column in Table2 based on the Article number present in the record in some other table from where i am clicking the button. Copy only those filtered records.

      I know we can use API_PurgeRecords to delete all the records in Table2. But i got stuck at how to copy the filtered records from Table1 to Table2. And that filter on Table1 should be dynamic filter as Article number changes from one record to another record from where i am clicking the button. 
    • QuickBaseCoachD's avatar
      QuickBaseCoachD
      Qrew Captain
      If this just needs to work in a single concurrent user environment, you can set up a table with a single record and have a field there to hold the Focus Article Number. Then make a relationship to the detail records based on a reference field with a formula value of 1, and then then look that up down to the detail records.

      Then, make a saved table to table import subject to the filer.

      Then you would make a URL formula button which would do the following steps.

      Write the Article number into the Focus table for record with Record ID# of 1. (As there only is one record there)

      Purge table 2

      Run the saved import.

      Land the user somewhere, probably on table 2.
    • MuraliGangineni's avatar
      MuraliGangineni
      Qrew Cadet
      Thanks for the quick response,

       I didn't understand how to achieve this thing  "Make a saved table to table import subject to filter"  and   "Run the saved import" .

      Can you please explain how to do that.
  • Murali, If you want to have this job run on a scheduled basis, you can create a scheduled automation. Otherwise, if you want it to run when something happens, such as a new record is added, or a record is modified or deleted and so on, create an appropriate automation. Then for actions, select "Copy Records" and specify the source table as table1 and apply the filter on table1. Then specify the target table as table2 and make sure you map the fields in table2 to the source fields in table1.

    The beauty of quickbase as told in the words of Kirk Trachy is: "If you can say a requirement in a sentence, you can do it in quickbase."

    Hope that helps.