lib/forms/index.js
function findFieldDefinition() {
    var foundField;
    if (!(params.fieldId || params.fieldCode)) {
      return undefined;
    }

    //Iterating through each of the pages to find a matching field.
    _.each(self.form.pages, function(page) {
      _.each(page.fields, function(field) {
        var fieldId = field._id;
        var fieldCode = field.fieldCode;

        if (fieldId === params.fieldId || fieldCode === params.fieldCode) {
          foundField = field;
        }
      });
    });

    return foundField;
  }
function findFieldDefinition() {
    var foundField;
    if (!(params.fieldId || params.fieldCode)) {
      return undefined;
    }

    //Iterating through each of the pages to find a matching field.
    _.each(self.form.pages, function(page) {
      _.each(page.fields, function(field) {
        var fieldId = field._id;
        var fieldCode = field.fieldCode;

        if (fieldId === params.fieldId || fieldCode === params.fieldCode) {
          foundField = field;
        }
      });
    });

    return foundField;
  }
function findFieldDefinition ( ) { var foundField ; if ( ! ( params . fieldId || params . fieldCode ) ) { return undefined ; } //Iterating through each of the pages to find a matching field. _ . each ( self . form . pages , function ( page ) { _ . each ( page . fields , function ( field ) { var fieldId = field . _id ; var fieldCode = field . fieldCode ; if ( fieldId === params . fieldId || fieldCode === params . fieldCode ) { foundField = field ; } } ) ; } ) ; return foundField ; }
Finding the JSON definition of a field to add data to.
Finding the JSON definition of a field to add data to .