Data Dictionary code

Data Dictionary code

FYI:

  1. void Utilities.Data_Dictionary()
  2. {
  3. // the following code INFOs tab-delimited form and field info for analysis in a Google or Zoho Sheet or Excel
  4. // "allcreatorscopes" is an internal connection that has access to all Creator scopes
  5. //
  6. // the delimiter (a tab)
  7. del = "\t";
  8. // the various types of fields: https://www.zoho.com/creator/help/api/v2/get-fields.html
  9. field_types = {1:"Single Line",2:"Multi Line",3:"Email",4:"Rich Text",5:"Number",6:"Decimal",7:"Percent",8:"Currency",9:"Auto Number",10:"Date",11:"Date-time",12:"Drop Down",13:"Radio",14:"Multi Select",15:"Checkbox",16:"Decision Box",17:"URL",18:"Image",19:"File Upload",20:"Formula",21:"Subform",22:"Zoho CRM",23:"Zoho CRM Link",24:"Add Notes",25:"Signature",26:"Users",27:"Phone",28:"Section",29:"Name",30:"Address",31:"Integration",32:"Audio",33:"Video",34:"Time",35:"OCR",36:"Object Detection",37:"Keyword Extraction",38:"Sentiment Analysis",39:"Prediction"};
  10. //
  11. // https://www.zoho.com/creator/help/api/v2/get-forms.html
  12. response = invokeurl
  13. [
  14. url :"https://creator.zoho.com/api/v2/" + zoho.adminuser + "/" + zoho.appname + "/forms"
  15. type :GET
  16. connection:"allcreatorscopes"
  17. ];
  18. forms = response.getJSON("forms").toList();
  19. // A header row for all of the data
  20. info "Form Link Name" + del + "Form Display Name" + del + "Field Link Name" + del + "Field Display Name" + del + "Field Type" + del + "Is Lookup" + del + "Visible" + del + "Unique" + del + "Mandatory" + del + "Max Char" + del + "Choices" + del + "Subform";
  21. for each  form in forms
  22. {
  23. form_link_name = form.get("link_name");
  24. form_display_name = form.get("display_name");
  25. //
  26. // https://www.zoho.com/creator/help/api/v2/get-fields.html
  27. //
  28. response = invokeurl
  29. [
  30. url :"https://creator.zoho.com/api/v2/" + zoho.adminuser + "/" + zoho.appname + "/form/" + form.get("link_name") + "/fields"
  31. type :GET
  32. connection:"allcreatorscopes"
  33. ];
  34. fields = response.getJSON("fields").toList();
  35. //
  36. for each  field in fields
  37. {
  38. info form_link_name + del + form_display_name + del + field.get("link_name") + del + field.get("display_name") + del + field_types.get(field.get("type").toNumber()) + del + field.get("is_lookup_field") + del + field.get("visibility") + del + field.get("unique") + del + field.get("mandatory") + del + field.get("max_char") + del + field.get("choices") + del + field.get("ref_form");
  39. }
  40. }
  41. }