Alternative email addresses lookup on approvals

KB15
Giga Guru

It's time I tackle this so I have a question. We have users with different email addresses (due to domain relationships). So when certain users attempt to approve a request, it'll reject them since their primary is not valid. I have a custom secondary email address field and just want to have ServiceNow check if the second email address matches.

I checked the inbound action called "Update Approval Request" and looking at this line:

function validUser() {
if (current.approver == email.from_sys_id)
return true;

Would it just be a simple addition of a condition or would I have to add a query?

10 REPLIES 10

Hi kkim,

My apologies for the delayed reply, I escaped for a bit of vacation.  I have never set this up as a scoped application, it was developed way back in Eureka and I implemented everything in the global scope.

The error you are getting sounds as though your application does not have cross-scope access setup for either the ScopedGlideRecord API or possibly the global tables involved in this solution (sys_user, sys_email, cmn_notif_device).  Reference on Cross-Scope access records, you could create those access privileges.

That being said, I don't know that I would set this up as a scoped app... the tables that need to be modified are all global, and the business rules that need to be running all relate to changes in those global tables.  I don't know of a way to get your scoped scripts to run in response to changes in the global tables (e.g., sys_email) other than creating a BR on that global table as a wrapper that calls your scoped scripts.  I don't really see the point in that, unless you want to apply protection to the application scripts so that the code can't be read by someone else, and then just call it functionally from the business rules.

 

-Brian