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

  • 0
  • 1
  • Question
  • Updated 3 months ago
  • In Progress
 Automatically Copy records from Table1 to Table2 after applying filter on Table1. 
Table1 and Table2 dont have any relation.
Photo of Murali Krishna Gangineni

Posted 4 months ago

  • 0
  • 1
What would you want to trigger copying records?
I got an issue in that...
As i am looking up the Summary Field of FocusTable into the BaseTable, It is giving me the last updated value of Summary Field instead of current updated value. This is happening when i click on the Formula URL Button with the below formula: 

var text URLONE = URLRoot() & "db/" & [_DBID_FOCUS_TABLE] & "?act=API_EditRecord"
& "&rid=1"
& "&_fid_6=" &  URLEncode([Article Number]);
& "&apptoken=xxxxxxxx";

var text URLTWO = URLRoot() & "db/" & [_DBID_FOCUSMASTER] & "?act=API_EditRecord"
& "&rid=1"
& "&_fid_7=" &  URLEncode([FocusMaster - Summary Field - # of Graphmasters]);

var text URLTHREE = URLRoot() & "db/" & [_DBID_Table2] & "?act=API_RunImport&ID=43";

var text URLFOUR = URLRoot() & "db/" & [_DBID_Table2] & "?act=API_RunImport&ID=44";

var text URLFIVE = URLRoot() & "db/" & [_DBID_Table2] & "?act=API_RunImport&ID=45";

var text URLSIX = URLRoot() & "db/" & Dbid() &  "?a=er&dfid=2&rid=" & ToText([RECORD ID#]) ;


$URLONE 
& "&rdr=" & URLEncode($URLTWO)
& URLEncode("&rdr=" & URLEncode($URLTHREE))
& URLEncode(URLEncode("&rdr=" & URLEncode($URLFOUR)))
& URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($URLFIVE))))
& URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($URLSIX)))))


Is there a way to get the current updated value ??

If not,
Is there a way to use Javascript in Formula URL to extract the number of records in the Table using API_DoQueryCount ?
I got an issue in that...
As i am looking up the Summary Field of FocusTable into the BaseTable, It is giving me the last updated value of Summary Field instead of current updated value. This is happening when i click on the Formula URL Button with the below formula: 

var text URLONE = URLRoot() & "db/" & [_DBID_FOCUS_TABLE] & "?act=API_EditRecord"
& "&rid=1"
& "&_fid_6=" &  URLEncode([Article Number]);
& "&apptoken=xxxxxxxx";

var text URLTWO = URLRoot() & "db/" & [_DBID_FOCUSMASTER] & "?act=API_EditRecord"
& "&rid=1"
& "&_fid_7=" &  URLEncode([FocusMaster - Summary Field - # of Graphmasters]);

var text URLTHREE = URLRoot() & "db/" & [_DBID_Table2] & "?act=API_RunImport&ID=43";

var text URLFOUR = URLRoot() & "db/" & [_DBID_Table2] & "?act=API_RunImport&ID=44";

var text URLFIVE = URLRoot() & "db/" & [_DBID_Table2] & "?act=API_RunImport&ID=45";

var text URLSIX = URLRoot() & "db/" & Dbid() &  "?a=er&dfid=2&rid=" & ToText([RECORD ID#]) ;


$URLONE 
& "&rdr=" & URLEncode($URLTWO)
& URLEncode("&rdr=" & URLEncode($URLTHREE))
& URLEncode(URLEncode("&rdr=" & URLEncode($URLFOUR)))
& URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($URLFIVE))))
& URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($URLSIX)))))


Is there a way to get the current updated value ??

If not,
Is there a way to use Javascript in Formula URL to extract the number of records in the Table using API_DoQueryCount ?
I cannot help you with javascript.

But I'm not really understanding your question.  You seem to be asking if you can obtain  a record count from after the imports?
I want to obtain the record count before the import and store that count value in a field or in a variable.
Ate you saying that this line here

& "&_fid_7=" & URLEncode([FocusMaster - Summary Field - # of Graphmasters]);

Has the value after the Import? That would seem impossible.
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.