Where Can I See More Async / Await?

  • 1
  • 2
  • Question
  • Updated 2 years ago
  • Doesn't Need an Answer
Where Can I See More Async / Await?
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,434 Points 20k badge 2x thumb

Posted 2 years ago

  • 1
  • 2
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,434 Points 20k badge 2x thumb
Below is another example of using Async / Await in script. Note there are no callbacks, or then() methods used and the script appears to be synchronous with one line of code executed after another.

Movies and Actors

https://haversineconsulting.quickbase.com/db/bm3wfa894?a=td

Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=599

This script is intended to be pasted into the console as indicated below:



Notes:

(1) To makes short demos that require as little maintenance on my part as possible I have to use a few tricks. So to indicate that the Cast fields is being updated each time the console script is run I simply pick a random delimiter to separate the concatenated cast members.

(2) It goes without saying that the report is only valid immediately after the script is run as the concatenated child records wold change at any time.

(3) Like the other Async / Await example we are intentionally calling API_EditRecord multiple times rather than calling API_ImportFromCSV to effectuate our changes.

(4) How you get this script to run is a workflow decision unique to your application and usage. You will need to bind the script to a button placed somewhere in your application (on the home page, report or form perhaps).
(Edited)