Skip to main content
Question

Automation for copying records in a report to a new table

  • June 19, 2018
  • 0 replies
  • 94 views

I have a table of orders. (Name, Order Number, Address, item number,etc)
I created a summary report to eliminate duplicate order numbers, and I'd like to automatically copy that to its own table. Is that possible through automation?

I know I can manually copy the records to a new table, but I am not able to think of a way to have these records copied to another table automatically. 
This topic has been closed for replies.

  • Registered
  • June 19, 2018
When viewing a report, under "More", there is an option to "Copy these records to another table". This then takes you to a fairly detailed window with a bunch of options for how the import should go. 

  • Author
  • Registered
  • June 20, 2018
But is there a way to automate this process? I can manually run this report and have the records copied to a new table ----- but I'd like this to happen daily or weekly, without me having to be the trigger

  • Registered
  • June 20, 2018
My head hurts trying to understand both the question and the replies. You people are so deep into the native feature jargon and their associated limitations I have no idea what you are trying to accomplish. Just state in simple terms what you are trying to accomplish and exemplify it with field and table names and sample data if necessary.

The following may or may not help lead to a solution:

One thing you may not be aware of is that if you take a saved summary report URL (say qid=5) and add the parameter &opts=csv to the URL you will in fact get a CSV response of the summarized data (not the raw un-summarized fields). This makes it almost trivial to import the summarized data into a second table with script. For example code like this will copy the CSV associated with a summary report (qid=5) and import it to a second table:

var dbid = "";
var dbidRecords = "";
var dbidSummaryOfRecords = "";
var apptoken = "";
$.ajaxSetup({data: {apptoken: apptoken}});
$.get(dbidRecords, {
  a: "q",
  qid: "5",
  opts: "csv"
}).then(function(csv) {
  console.log(csv)
  $.post(dbidSummaryOfRecords, {
    act: "API_ImportFromCSV",
    records_csv: csv,
    clist: "6.7",
    skipfirst: 1
  }).then(function(xml) {
    console.dirxml(xml);
  });
});