The below formula is a copy of what is currently in the 'TRY IT OUT' button below. When clicked, it will make a single edit to this record, updating the value of the [Approval Status] to be Approved or Rejected (toggling back and forth), logging the name of the Approver (as a function of random assignment) as well as the Approval time (right now)
For organization purposes - some of the inputs are organized into variables to highlight the actual edit record at the bottom.
var text approval = If( [Approval Status]="Approved","Rejected","Approved");
var number rand = Mod(Second(ToTimeOfDay(Now())),4);
var text approver =
Case($rand,
0,"Marcus Aurelius",
1,"Achilles",
2,"Plato",
3,"Socrates",
"Who Knows");
The full API_EditRecord with a redirect back to this record
"https://quandarycg.quickbase.com/db/bn22wn4cx?a=API_EditRecord&rid=7&_fid_41=" & $approval & "&_fid_40=" & URLEncode($approver) & "&_fid_42=" & URLEncode(Now()) & "&rdr=" & URLEncode("https://quandarycg.quickbase.com/db/bn22wn4cx?a=dr&rid=7")