getFieldNames()
Table of Contents
Note: This help page is applicable only to Zoho Creator
Overview
The getFieldNames() function returns the link names of all the fields in a form.
Return Type
- LIST
Syntax
<variable> = getFieldNames();
// this syntax is not applicable to custom functions
// this syntax is not applicable to custom functions
(OR)
<variable> = <collectionVariable>.getFieldNames();
Parameter | Description | Data type |
---|---|---|
<variable> | Variable which will contain the returned list of field link names. | LIST |
<collectionVariable> | A collection variable which holds records fetched using the fetch records task. | -- |
Example 1: Fetch field link name
The following snippet fetches records based on a given criteria and then extracts the field link names from a record in the collection.
collectionVar = Registrations[Email == "john@zylker.com"]; fieldNames = collectionVar.getFieldNames();
Example 2: Fetch display name of Zoho Creator fields using API
The following script fetches the display names of all the fields from the Zoho Creator form - form1 of the application - app1:
appLinkName = "app1"; formLinkName = "form1"; authtoken = "54927XXXXXXXXXXXXXXXXXXXXXX924e3"; url = "https://creator.zoho.com/api/json/" + appLinkName + "/"+ formLinkName + "/fields?authtoken=" + authtoken; response = invokeUrl [ url: url type: GET ];
where:
response
The KEY-VALUE variable that holds the display name of all the fields of the specified form.
url
The TEXT that represents Zoho Creator API URL that lists all field names.
appLinkName
The TEXT variable that holds the link name of the application from which the field names need to be fetched.
formLinkName
The TEXT variable that holds the link name of the form whose fields need to be fetched.
authtoken
The TEXT that represents the authtoken of the Zoho Creator account from which the field names need to be fetched.