Is there a way to see who has EXPORTED data, and include a date/time stamp?

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • In Progress
I am trying to determine if a User exported the client list in a particular time frame.   Can this be done?
Photo of Stephen

Stephen

  • 20 Points

Posted 1 year ago

  • 0
  • 1
Photo of Matthew Neil

Matthew Neil

  • 31,438 Points 20k badge 2x thumb
Not that I know of, but you can now control which roles have the permissions to export data. 

You can modify this in the roles and permission settings.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,572 Points 20k badge 2x thumb
Yes there is a way to do this using a Service Worker. You can do this in Chrome, FireFox, Opera today and on or about Otober 17 in Edge.

Rather unexpectedly a new development has happened in that Clourflare (a hosting company) has adopted the Service Worker API that works server side rather than client side (in your browser) and created a jsfiddle.net like playground were you can implement a Service Worker to operate against any domain and share it. So that is exactly what I have done here:

Log Exports to Log Table Service Worker
https://cloudflareworkers.com/#0faeec792c0279d10ba9b2e1f5f4348c:https://haversineconsulting.quickbas...

Feel free to load this page and navigate around my QuidkBase applicaiton. If you choose either of the two predefined CSV reports (CSV1 or CSV2) they will download in the usual fashion the CSV file as well as  be logged to the Log table automatically by the Service Worker. This just a simple demo where I am only detecting the qid=5 or qid=6 reports are being requested but a more comprehensive logic could detect other CSV export URL by various other means.




Here is the code shown in the playground highlighting the regular expressioin I am detecting 
var dbid = "bm5tmtkbc";
var dbddTable = "bm5tmtkbx";
var dbddLogs = "bm5tnrevv";
var apptoken = "dkcygh3dsf2nsbpzkj2kyar2xj";
addEventListener("fetch", event => {
  event.respondWith(fetchAndLog(event.request))
});
async function fetchAndLog(request) {
  let response = await fetch(request);
  let re = new RegExp(/bm5tmtkbx\?a=q&qid=5|bm5tmtkbx\?a=q&qid=6/);
  let urlVisited = request.url;
  if (re.test(urlVisited)) {
    var formData = new FormData();
    formData.append("_fid_6", urlVisited);
    await fetch("https://haversineconsulting.quickbase.com/db/bm5tnrevv?act=API_AddRecord";, {
      method: "POST",
      body: formData
    });
  }
  return response;
}
This same code can be used for a Service Worker in your browser today to accomplish the same thing

(Edited)