Pulling user data from frevvo

To pull the current users data from Frevvo use the '_data.getParameter('<data name>') syntax.

The example code below is pulling the users first name, last name, and email from Frevvo as soon as the page loads:

if (form.load){
  //set variables to hold the data when pulled
  var firstName = _data.getParameter('subject.first.name');
  var lastName = _data.getParameter('subject.last.name');
  var email = _data.getParameter('subject.email');
  
  //populate the data into the appropritae fields in the form
  StudentName.value = firstName + " " + lastName;
  StudentEmail.value = email;
}

**StudentName, & StudentEmail are all the exact names of the controls in the form. For rules to work properly, the name for each control needs to be different. If you rename the control in the properties window then you also must change it in the code.**

 

Pulling Current Date:
To auto-pull the the current date use the 'frevvo.currentDate)()' syntax

//Setup a Trigger to initalize the rule
if (form.load) {
    //Date control is named Date
    Date.value = frevvo.currentDate();
}


**Trigger can be based on when a form loads or if a field has been completed (ex: signature based). In this example the Trigger is when the form loads.