Most customers will have a need to add specific, one off forms to their environment.  Adding forms is a straightforward process.

Create a new Form

  1. Create the new form as a Resource and save it.  Stay in the Form's editor.

  2. Any standard submit button should be deleted.  In the Component toolbox, click Existing Resource Fields and then select S9 H2R Components.



  3. Click and drag S9H2R_Buttons from the toolbox onto your form.  This will add cancel and save buttons to your form, and will include the custom logic to route users back to the Hire to Retire Landing Page.  You can move or style the buttons to fit your specific needs, but any scripts should not be altered.

  4. Click and drag S9H2R_Config from the toolbox onto your form.  This component contains necessary script logic for Hire to Retire forms to operate within the package.  This component should not be altered.  It is by default hidden when forms are viewed.

  5. To make locating forms easier, add a Tag consistent with the other forms.  All stock Hire to Retire forms contain the tag s9h2r.  This makes filtering the forms in view much easier.

  6. Save the new Form.  Click the Home button in the title bar to navigate back to the Forms and Resources lists.

Update the Landing Page

  1. In the Forms list, edit the HR Onboarding form.

  2. Scroll to the bottom of the form and duplicate one of the resource form links.



  3. On the copied component, click the settings gear to open the configuration panel for the component.

    1. On the Display tab, give the component a new Label that is descriptive to the form you are adding to the package.

    2. On the API tab, ensure the Property Name is unique and descriptive to the form being added.

    3. On the Data tab, change the selected Resource to the new form Resource created in the previous section.

    4. Click the Save button to commit your changes and close the settings panel for the component.

  4. Duplicate an existing landing page link by clicking the copy button on an existing Component in the Company Forms or Government Forms section.



  5. On the copied component, click the settings gear to open the configuration panel for the component.

    1. On the Display tab, update the Content field with the text to display for the link.  This is placeholder text for organization purposes.

    2. On the Conditional tab, you will need to update the Advanced script.  This script is used to link the user to a resource form, and where appropriate, a submission of that form.

      if(data.intakeComplete == "false")
      {
          show = false;
          return;
      }
      if(data.resources && !data.ddLinked)
      {
          var linkItem = data.resources.find(item => {
             return item.machineName == 'directDeposit';
          });
          
          if (linkItem && linkItem._id && data.currentUser)
          {
      		data.ddLinked = true;
      		
      		var s9Forms = new Formio(data.s9BaseUrl + '/' + linkItem.machineName);
      		s9Forms.loadSubmissions({params:{'data.currentUser':data.currentUser}}).then(function(submissions) {
      			if (submissions.length === 0)
      			{
      				component.content = '<a href="'+data.s9BaseUrl+'/view/#!/form/' + linkItem._id + '">Direct Deposit Form</a>';
      			}
      			else if (linkItem)
      			{
      				component.content = '<a href="'+data.s9BaseUrl+'/view/#!/form/' + linkItem._id + '/submission/' + submissions[0]._id + '/edit' + data.editQueryString + '">Direct Deposit Form <span class="fa fa-check"/></a>';
      			}
      		});
      	}
      }
      show = true;
      JS
    3. Make the following edits:

      1. At line 14, a variable is created and set to identify when a user has previously entered data for the new form.  This variable is initially checked to exist at line 6.  Modify the text ddLinked on line 6 to a variable name that represents your new form.

      2. Modify the text directDeposit on line 9 to the API Property Name created for the resource form link (Step 3b).

      3. Ensure the variable ddLinked at line 14 is changed to match the value specified in step i.

      4. Update the link text to represent the new form at lines 20 and 24.

  6. Verify you have made all required changes and click Save to close the settings dialog.

  7. Click Save Form.  The new user defined form is now part of the Hire to Retire application and is ready to accept submissions.

Security

You will want to set appropriate permissions for any new forms.  Form permissions are controlled on the Access Tab of the Form Designer.  While power users may want to set specific permissions, the default permission set is outlined in the access screen below.