Why is it too complicated to just add in the function that I gave you???
But okay, we can hack it another way:
Code:var str = email.body_text; var theMatch = str.match(/number\:\s+(\d+)$/i); var refStr = theMatch ? theMatch : "no valid number given"; externalReferenceNumberCreate(current.sys_id, 'Client reference number',refStr, 'Client number');