1. Home
  2. Docs
  3. How to
  4. How to send form information from WordPress to Salesforce

How to send form information from WordPress to Salesforce

This post will explain steps to send form information from WordPress to Salesforce.

    1. The first step is to the download the HTML Forms plugin. This is simple plugin that will let you easily create and manage forms.
    2. The Sawfish plugin would let you to both create and update records on WordPress.
    3. In the form we mention a few additional fields in order to connect to the correct object in Salesforce. The updating a record the Id of the record should be included as well.
    4. After installing the HTML Forms plugin, navigate to the plugin screen from the WordPress dashboard.
    5. Click Add New Form. To set values, in Salesforce the field API names should match the name parameter of each field in the form.
    6. Along with the set fields, include the following fields as hidden fields.
      1. i) sf-o for the object you’d like to connect to
        ii) sf-form for the type of form. Here, set it to create or update.
        iii)sf-nameoffield for the type of form. Where nameoffield is the API name of the field name. Eg: sf-Email__c

    7. Here’s a simple form to create a Contact record on Salesforce.
      <input type="hidden" name="sf-o" value="Contact" />
      <input type="hidden" name="sf-form" value="create" />
      
      <p>
      <label>Your First Name</label>
      <input type="text" name="sf-FirstName" placeholder="Your First Name" required />
      </p>
      <p>
      <label>Your Last Name</label>
      <input type="text" name="sf-LastName" placeholder="Your Last Name" required />
      </p>
      
       
      <p>
      <input type="submit" value="Send" />
      </p>
    8. Similar format can be followed for updating a record on Salesforce. Add another hidden field : sf-Id so that the correct record can be updated in Salesforce.
      <p>
      	<label>Record Id</label>
      	<input type="text" name="sf-Id" placeholder="Record Id" value="0030K00002XNdFL" />
      </p>
    9. That’s it! Now, add the form to a Page or a Post in WordPress and check out the record in Salesforce.
Was this article helpful to you? Yes 2 No