Add data to a different application
Requirement
Automatically add a record to a form of one application when a record is added in a different application.
Use Case
A Zoho creator account has two applications: Contact Management and Order Management. All the customer details maintained in the Order Management app needs to be added as contacts in the Contact Management application.
So, when a record is added in Customers form of the Order Management app, a contact is automatically created in the Contact Management app.
Steps to follow
Application | Form | Field |
Display Name | Link Name | Display Name | Link Name | Type | Display Name | Link Name |
Contact Management | contact_management | New Contact | New_Contact | Name | Name | Name |
Email | Personal Email ID | Personal_Email_ID |
Phone | Phone Number | Phone_Number |
Order Management | order_management | Customers | Customers | Name | Customer Name | Customer_Name |
Email | Email | Email |
Phone | Phone Number | Phone_Number |
2. Create a
Deluge function in the
Contact Management application with the function name as
'Add_customer' and return type as
void. Specify the arguments as shown in the table below.
Argument name | Data type |
First_Name | string |
Last_Name | string |
Email | string |
Phone | string |
3. Add the following script in the Deluge editor that opens after you create a function.
- //Insert records to the 'New_Contact' form in the 'Contact Management' application
- //Assign respective function arguments as form field values.
- Add_customer_data = insert into New_Contact
- [
- Name.first_name = First_Name
- Name.last_name= Last_Name
- Personal_Email_ID = Email
- Phone_Number = Phone
- Added_User = zoho.loginuser
- ];
4.
Create workflow
in the
Order Management
application with the following details.
4. Click
Add New Action > Deluge Script
and add the following
snippet:
- //Call the 'Add_customer' function created in the Contact Management application.
- contact_management.Add_customer(input.Name.first_name,input.Name.last_name,input.Email,input.Phone_Number);
See how it works