var TESTING = true; const testEmail = "test@test.org"; var directorName = ""; var directorEmail = ""; var managingEditorName = ""; var managingEditorEmail = ""; //I created this to test if this function gets called from Form Load event (call function) rule. //this does get called. I see the result in the browser dev console. function getEmailsAndNamesOrd() { console.log("ordinary"); } //this function is supposed to get called from a rule that gets triggered by the Form Load event. //I used the call a function action to call this function. //I dont see the 'async' output in the browser dev console. async function getEmailsAndNames() { console.log("async"); //check if _ltpSPO is loaded. if (!_ltpSPO) { dffs_showModal({ title: "Scripts load error", body: "Some required scripts for this page did not load properly. Please do key combination CTRL + SHFT + R to refresh the page.", isBlocking: true, showClose: true, showFooter: false, }); } const getEmailsAndNamesAsync = [getDirectorInfo, getManageingEditorInfo]; //this is a function that runs all the async functions. //this function resides in an external script that i load at the 'Load external JS section' //_ltpSPO is available in the browser dev console and i am able to run functions that are exposed from it. await _ltpSPO.runAsyncFunctions(getEmailsAndNamesAsync); if (TESTING) { directorEmail = managingEditorEmail = testEmail; } } async function getDirectorInfo() { let result = await _ltpSPO.getFormattedUserInfo("Director"); if (result) { directorName = result.name; directorEmail = result.email; } } async function getMarketingAndSalesManagerInfo() { let result = await _ltpSPO.getFormattedUserInfo("Managing Editor"); if (result) { managingEditorName = result.name || directorName; managingEditorEmail = result.email || directorEmail; } }