Autopopulate Zoho Creator field with Zoho People data | Zoho Creator Academy

Autopopulate Zoho Creator field with Zoho People data

Requirement

Autopopulate Zoho Creator field with employee information stored in Zoho People.

Use case

Let's assume an organization named Zylker has a private library. The regular users must purchase a membership in order to access the library, however, Zylker employees can use the library free of cost. Zylker uses Zoho People to manage their employees and a library management Zoho Creator app to manage the library. On entering the Zylker employee ID in the Borrow Resource form which is used to loan books from the library, the employee's name will be fetched from Zoho People and auto populated in the Zylker Member field.

Steps to follow

1. Create two forms with the following details:

Form

Form Link Name

Field Type

Field Name

Field Link Name

Add Member

Add_Member

Number

Member ID

Member_ID

Name

Name

Name

Phone Number

Phone Number

Phone_Number

Address

Address

Address

 

Borrow Resource

 

Borrow_Resource

Radio

Are you a Zylker employee?

 

Are_you_a_Zylker_employee

  • Yes

  • No

Lookup (Add Member)

 

Member

Member

Single Line

Employee ID

Employee_ID

Single Line

Zylker Member

Zylker_Member

Single Line

ISBN/Barcode

ISBN_Barcode

Date

From Date

From_Date

Date

To Date

To_Date


2. Create and authorize Zoho People connection with the following details. This connection will be used in step 8 in the Deluge integration task to fetch employees' information from Zoho People.




3. Create a workflow to execute on load of the the Borrow Resource form.



4. Click Add New Action and select Deluge Script. Add the below code:
  1. hide Employee_ID ;
  2. hide Zylker_Member ;
  3. hide Member ;
5. Create another workflow to execute on user input of the Are you a Zylker employee? field:



6. Click Add New Action and save the following Deluge snippet in the Deluge editor. This script dynamically shows/ hides Employee_ID, Zylker_Member, and Member fields.
  1. if(Are_you_a_Zylker_employee == "Yes")
  2. {
  3.  show Employee_ID;
  4.  show Zylker_Member;
  5.  disable Zylker_Member;
  6.  hide Member;
  7. }
  8. else if(Are_you_a_Zylker_employee == "No")
  9. {
  10.  show Member;
  11.  hide Employee_ID;
  12.  hide Zylker_Member;
  13. }
7. Create another workflow to execute on user input of the Employee ID.



8. Click Add New Action and save the following Deluge snippet in the Deluge editor. 
  1. // Fetch the Zoho People record that matches the inputted employee ID using Zoho People -Get Records integration task
  2. searchMap = Map();
  3. searchMap.put("searchField","EmployeeID");
  4. searchMap.put("searchOperator","Is");
  5. searchMap.put("searchText",Employee_ID);

  6. response = zoho.people.getRecords("P_Employee",0,1,searchMap,"people_connection");

  7. // Populate the Zylker_Member field with the fetched value
  8. Zylker_Member = response.get(0).get("FirstName") +" "+ response.get(0).get("LastName");

See how it works



  1. Zoho People integration task
  2. Show/Hide fields
  3. Disable fields
  4. Connections