Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Navigate to the GlobalForms installation directory in Windows Explorer and open the config folder.  Open the file configdefault.json in a text editor and find the mssql section.  It will looks similar to this:

...

Modify the settings in this configuration section for your specific environment.  Remember, your SQL Server instance must be setup to listen on the TCP/IP protocol.  The Make the changes and restart the GlobalForms service for the changes to take effect.

In this example, you will enter a First Name and Last Name to be inserted into an Employees table.  The table includes must include an auto-incrementing Identity column that will be used as an employee ID.  The script to create that table is below for reference:

...

Give the Action a descriptive Title.  If you have multiple Actions, it is helpful to be able to easily identify them for maintenance and support.  In the SQL Server Type drop down, choose Microsoft SQL Server.  In the Query box, you can type a SQL statement to execute.  Using the table defined above, you can insert into the table with the following script:

Code Block
languagesql
titleSQL Insert
insert into Employees (FirstName, LastName) VALUES ('{{ data.firstName }}','{{ data.lastName }}');

Alter the Handler setting if required, the Handler controls when the action is fired, either before or after the submission is created, updated, etc. 

Select the Method that Applies to you:

You can fire your Form Action on a few events including:

  • Create - Fires your event on the creation of a submission.  In this example, we use a Create Method.
  • Update - Fires your action on update of a submission, you should use this if you need to fire your event if a document is getting updated, for example by a user in GlobalCapture via the Batch Manager.

In addition, other Methods exist, including:

  • Delete
  • Read
  • Index

A few things to note about the insert into Employees:

...

Click the Save Action button to save the changes.  Test the insert by submitting the form.  You should see the submitted data inserted into the SQL Table.  The file below

This link is the form Employees Resource used in this example. View filenameEmployees.jsonheight250  Import it into your own GlobalForms instance to experiment with the form and review its configuration.