When collecting form data, occasionally there is a reason to exclude a field from the submission to SharpSpring. The most common reasons for this are:
- Sensitive data like passwords, social security numbers, etc., which should not be transmitted over the connection to SharpSpring.
- Fields that cause form submissions to fail. Some third party providers add additional fields that do not need to be collected by SharpSpring, but have names or data that cause issues due to length or special characters.
The following User Roles have access to create native forms in SharpSpring, which is necessary to make the edits as instructed in this article.
- Marketing Manger
Follow these steps to edit your native form embed code to exclude passing specific fields.
Step One: Create a native form. For help creating a native form, review the article Mapping Native and 3rd-Party Forms.
NOTE: Steps two through four require editing the native form tracking script to exclude specific field values. These edits should be made in a text editor (Atom, Brackets, Sublime Text, etc.). To help ensure you have made the correct edits, there are a before / after of the native form script directly after step four.
Step Two: Add the line
var hidden = ; directly below the line
var __ss_noform = __ss_noform || ;
Step Three: Underneath the
var hidden = ; line, add a
hidden.push("field_name_1"); line for each field to be excluded. The field_name_1 value will come from the name attribute of the form input to be excluded.
In the line above, the value to use is thePassword. The line added to the native script will then be:
hidden.push("thePassword");. Repeat this for every field we need to exclude.
Step Four: Add the line
__ss_noform.push(['exclude', hidden]); directly below the line
Native Script Before Edits
Native Script After Edits
Step Five: Place the edited native form script before the closing <form> tag or closing <body> tag.
Step Six: Submit the form and map the field values in SharpSpring. Any field excluded will not appear on the field mappings page for your form. If you are not familiar with mapping native forms, refer to the article Mapping Native and 3rd-Party Forms.