Insert Data From a Custom List
Goal:
Insert data from columns in a Custom List to Text Inputs in a Document or Bundled Documents based on data inserted another Text Input. The script will search your Custom List and will automatically insert the email corresponding to the inserted name.
Instructions:
- Create the Template tag EmployeeName and attach this tag to a Text Input in your Template where users will insert name of an employee who will, for example, sign a document on behalf of a company.
- Create the Template tag GetEmployeeEmail and attach this tag to a Text Input in your Template where should be a contact email to an employee who will, for example, sign a document on behalf of a company.
- Create a Custom List with the name Authorized Employees that will contain two columns: Employee Name and Employee Email.
- Insert some data to that Custom List (insert rows).
- Insert the below-mentioned script to the EmployeeName tag.
Script Example:
for(var i in Tags){ if(!Tags[i].isSystem()){ var MyTag = Tags[i]; }
for(var i in AuthorizedEmployees){ if(AuthorizedEmployees[i][“employee-name”] == str){ for(var iii in FindEmployeeEmail) { FindEmployeeEmail[iii].setValue(AuthorizedEmployees[i][“employee-email”]); }
|