Quantcast
Channel: Zoho Creator Knowledge base
Viewing all 32 articles
Browse latest View live

Mail Merge with Zoho Creator

$
0
0

If you are looking for an easy method to create a Mail merge of the Form data you have, please use send mail task. Check out https://help.creator.zoho.com/Send-mail.html

Creating Advanced Mail merge process involves the following components in Zoho Creator. It becomes mandatory to have some basic ideas about them. 
  1. Data View
  2. HTML View/Page
  3. Fetching records from the Form
  4. Functions
  5. Custom Actions
1. Create a Data View:

I hope that you are aware of the Data View. Data Views in Zoho Creator are used to display the Form data as list/summary/grid/calendar format. Data Views do not allow you to construct your own HTML template for the Form data. For this, you will need an HTML View.

2. Create an HTML View and add parameters to pull records from the database:

HTML Views can be used for the purpose of displaying records in a customized layout. It is constructed in a way to load records dynamically, meaning you can display dynamic HTML content by passing different values to it. This feature allows users to pass the different Form record values to the HTML page and alter the HTML template values respectively.

3. Inside the HTML View, fetch the records from the Form based on the passed record ID:

This becomes mandatory when the dynamic HTML View has to access a Form record. Deluge has a Fetch records task that allows you to pull records from any database Form within the application based on the criteria provided. For example, you can pass the email address of a person and retrieve his information from the database.

4. Create a Function to write a script that opens HTML View:

Functions are pieces of code that can be executed on demand. They can be used in any application under the same account. Functions can generate output with or without any input.

5 To call the Function from the View, use Custom Actions:

Custom Action is set up on a data View to execute a function. It can also pass the Form record values to the function associated with it.

The image below shows how Mail merges work in Zoho Creator.

Can’t see Form data on Views?

$
0
0

It’s probably because of a search you made recently. Our new search feature in Views maintains the last searched keyword as the default filter. To remove that filter and show all the records, 

  1. Access the View
  2. Below the View name header, locate the buttons 
    Save
    , Save as
    and Reset
    and click on 
    Reset
    (Color of the button changes according to the application theme)
  3. You should now see all your records. 
If you still don’t see any data, check if there are any criteria set up. Refer https://help.creator.zoho.com/Set-Criteria.html

If the above steps don’t fix your problem, please contact support.

How to fetch data from two forms and update it in a HTML view?

$
0
0

1. Assume you have 2 forms : “Customer” and “Purchase”

2. In “Purchase” Form, if “CustomerInfo” is a lookup field referring to the “Customer” form, the related fields of the Customer Record (their name, address etc)  can be directly accessed from the collection variable.

3. The sample code given below will fetch data from the Customer form

  1.      purchaseInfo  =  Purchase[ID == input.id];    
  2.      info purchaseInfo.CustomerInfo.Last_Name;
  3.      info purchaseInfo.CustomerInfo.First_Name;
  4.      info purchaseInfo.CustomerInfo.BirthDay;

In the above code,

- “purchaseInfo” is the collection variable which holds the records from the Purchase form, based on the specified criteria.

- purchaseInfo.CustomerInfo.Last_Name will fetch the value of the Last_Name field from the “Customer” form based on the lookup

How can I set the parameter of an HTML view with current date, if parameter is empty?

$
0
0

 
If no parameters are passed to an HTML view, the parameter will be set as “null“. Add the following code to your HTML view, to set the parameter to current date, if the parameter is equal to “null”.


if (input.parameter == null)
{
input.parameter = zoho.currentdate.toString();
// As parameter is a string value, the date is converted to string
}

How do I print a record – The not so simple method.

$
0
0

You can also invoke a custom function to open the record in a new page and subsequently print it. To do so, Please follow the steps mentioned
below:

  • Click on “Edit this application” and click on “Script” tab.
  • Click on “Functions” displayed in the top left corner. [Below the various tabs.]
  • You can create a function, viz Print_Rec, with an argument. In this case the argument can be an interger.
  • Drag and drop the openUrl task into the deluge editor.
  • Click on “edit” of the openUrl task.
  • Specify the following url string:
“https://creatorexport.zoho.com/”+zoho.adminuser+”/”+zoho.appname+”/print/view_Link_Name/ID=”+input.ID

where view_Link_Name is the view from which the records are to be printed and input.ID is the incoming ID argument.

To export it to PDF use,

“https://creatorexport.zoho.com/”+zoho.adminuser+”/”+zoho.appname+”/pdf/view_Link_Name/ID=”+input.ID

  • Select the openUrl in as “New Window”.
  • Click Done to add the task and click “Save Script” to save the function.
  • Mouse over the “Views” tab and navigate to the view in which this function is to be included.
  • From the left pane, from under “Display”, click on “Column Properties”.
  • Select the “ID” field to be displayed in the view.
  • Form under “Actions” in the left pane, click on “Custom Actions”.
  • Specify
    the function name to be displayed in the view, select the “Print_Rec”
    function that we just created and pass the “ID” as the argument.
  • Click “Done” to save.

When
you access the view now, you can see the function being displayed next
to each record. Clicking on the function will execute the function.

How do I enable export options (print, CVS,etc) for a view embedded in my HTML page?

$
0
0

You can directly place the URLs as linked text.

a. To print the view, place a linked text in the format given below:

<a href=”http://creatorexport.zoho.com/appOwnerName/appLinkName/print/viewLinkName“>Print </a>

b. To export the view in CSV format, place a linked text in the format given below:

<a href=”http://creatorexport.zoho.com/appOwnerName/appLinkName/csv/viewLinkName“>CSV Export </a>

Refer to http://help.creator.zoho.com/Functionality-based-URLs.html learn more the URL patterns.

How can I add a button to each entry in the “Leads”list that would say “Copy to Clients”and copy that record into the “Clients”list

$
0
0

About the application

The application “Copy Records” comprises of the following two forms – Leads and Clients.

  1. Leads form with fieldsName – Phone – Email to enter the Lead details.
  2. Clients form with fields Name – Phone – Email – Address to enter the Client details.

When a lead becomes a client, the lead details are updated in the
Client table. This is achieved by adding a custom action button to each
record in the Leads view. Selecting the button will invoke a function to add the specific record to the clients form.

Deluge Script

1. Add a function to copy the record from the Leads form to the Clients form

The function copyRecord is added to the Script ->Functions tab. This function is invoked when you click on the Copy to Client custom action button. 

void copyRecord(string Name, int Phone, string Email)
{
insert into Clients
[
Email = input.Email
Name = input.Name
Phone = input.Phone
Added_User = zoho.loginuser
]
}

2. Configure the above function as a custom action in the Leads view

Select Views ->Leads View ->Custom Actions and specify the
name of the action as Copy to Clients and click on show action for each
record
. Specify the required values and click Done.


To install the application

  1. Download the script file (.ds file)
  2. Install the application to your account.Click here to learn how to install using the script file (.ds file)

I have a view listing events with dates. How do I show only the upcoming events in it?

$
0
0

By applying a simple criteria to the view, you can display only the upcoming events.To set this criteria:

  • Click on “Edit this application” and navigate to the view in which this criteria is to be applied.
  • From the left pane, from under “Records”, click on “Set Criteria”.
  • Click on the “Advanced” link in the top right corner.
  • In the text area below, enter the criteria
Date_Of_Event >=zoho.currentdate

where, Date_Of_Event is the deluge name of the Date field present in the Form/View.
  • Click “Done” to save.

When the view is accessed, only the records that match the criteria set will be displayed. At any point, you can remove the criteria to display all the records.


How can I fetch all the records in a form?

$
0
0

To fetch all the records in a form, specify the criteria as [ID != 0], where ID is a auto-generated field that contains a unique value for each record in the form.

Example:

rec = Contact [ID != 0] sort by Added_Time range from 1 to 5;

where,

rec it is the name of the collection variable that contains form data.

Contact name of the form whose data has to be fetched.

[ID !=0] is the criteria expression.

sort by Added_Time – the field based on which the records will be sorted. Here, Added_Time is the Deluge variable, which returns the time when the record was added.

range from 1 to 5 –
range enables you to limit the records fetched within the start index
(x) and end index (y). If range is not specified, all the records in
the form that satisfy the given criteria, will be fetched.

How can I fetch records within a given range

$
0
0

To fetch records from a Form within a given range, specify the start index and end index range in the Fetch records task, as shown in the sample code below. Here, the first five records that are sorted by Added_Time field will be fetched from the Contact form. You can add the script to the Form Actions -> on add ->on success block to fetch records when a new record is submitted to the database.


rec = Contact [ID != 0] sort by Added_Time range from 1 to 5;

where,

rec it is the name of the collection variable that contains form data.

Contact name of the form whose data has to be fetched.

[ID !=0] is the criteria expression.

sort by Added_Time
- the field based on which the records will be sorted. Here, Added_Time
is the Deluge variable, which returns the time when the record was
added.

range from 1 to 5 –
range enables you to limit the records fetched within the start index
(x) and end index (y). If range is not specified, all the records in
the form that satisfy the given criteria, will be fetched.

In the Script Builder UI, drag-n-drop the Fetch Records task and click on Edit, to specify the Sort column and Range in the Fetch records dialog, as shown in the screen-shot given below:

The Edit dialog to specify the sort field, the sort order and range will be displayed. Specify the values and click Done.

 

To show the latest of a clients record that matches a given criteria

$
0
0
To show only the latest record of each client that matches a certain criteria on that view. For example – show the latest record of each client where its ‘Rank’ field contains the string “KYU”

1. Add a script to fetch the record from the form that matches the specified criteria.  

if(count(yourFormName [ClientName == "Jay" &&Rank == "KYU"]) >0) 
{
requiredRecord = yourFormName[ClientName == "Jay" &&Rank == "KYU"] sort by Modified_Time desc range from 1 to 1;
thisID = requiredRecord.ID;
}

Note: In the above code thisID is the user-defined variable that holds the ID of the latest record that matches the specified criteria.

2. Navigate to your View for this Table by specifying the view name and the ID of the record in the openurl Deluge task.

openurl("#View:yourViewName?ID=" + thisID,"same window");

You can also deploy the code in an HTML View and just render the other fields in the record using Html code. The other fields can be referenced using requiredRecord.fieldX like references.

Create multiple views from same form for different set of users

$
0
0
 

Is it possible to hide fields, so that I have two views of the same form – let’s say, an administrator view (which shows all the fields, hidden or not) and a user view, which just shows the public fields?”


Create2 Views of the same Form as described below:

  1. Create the first view, named View1 with all fields (columns) being displayed and restrict the access to this view to just the Owner. This is done via the Share Tab in Edit Mode, by sharing the view to the required email-id. By default, the application owner (admin user) has access to all the Forms and Views in the application. So you just have to make sure that other users do not have access to this View.
  2. Create the second view, named View2 with only the required fields to be displayed to the user. Use the Column Properties link in the left panel to turn off display of fields (columns) and you give your other Users Share Access to this View. This is done via the Share Tab in Edit Mode, by sharing the view to the required user email-ids.
  • If you want to restrict these other users tojust viewing the individual record, use the Set Permissions link in the left panel and make sure the Add, Edit and Delete capabilities are turned off.
  • If you need to permit these other users to (say) Edit records but be restricted to just the fields they can view, then in the on Edit ->on Load section of your Form, add Deluge Script to check if zoho.loginuser is the same as zoho.adminuser. If they are different, you have to have a series of hide <fieldname> commands to hide them in the Edit Form as well. Refer the Show Hide fields for more information.
  • You can do the same in the on Add ->on Load section of your form but you have to be careful that some key/required fields are not hidden from such users.
Viewing all 32 articles
Browse latest View live