This Node.JS module parses lead data by type.
var types = require('leadconduit-types');
var phone = types.phone.parse('(512) 789-1111');
console.log(phone);
In LeadConduit each field has an associated type, which is used to help make sense out of submitted lead data. The following table summarizes all supported types and provides some example values for each.
Data Type | Description | Examples |
---|---|---|
string | Any string data which can include alphanumeric characters, whitespace, special characters, new lines, etc. | John , I would like some information on your product , 0123 |
number | Any string which can be parsed to a number | 1000 , 9,998.99 |
boolean | Any string wich can be parsed to a boolean | true , 1 , yes |
date, dob | Most strings which are reasonably recognizable as a date, including European formats (month before day) | 1995-12-25 (recommended), Dec 25, 1995 , 12/25/1995 , 25/12/1995 |
time | Most strings which are reasonably recognizable as a datetime, including European formats (month before day) | 2014-06-14T18:27:33.000Z (recommended), 2014-06-14T18:27:33Z , 06/14/2014 6:27:33 PM , Sat Jun 14 2014 13:27:33 GMT-0500 (CDT) |
ssn | A US Social Security Number. Data submitted in this field transient. It is never stored or logged by LeadConduit. | 123-45-6789 , 123 45 6789 , 123456789 |
postal code | A US, UK, or Canadian postal code | 78751 , 78751-4424 , AA11A 1AA |
state | A US State abbreviation, or international locality | TX , Quebec |
range | A numeric range, with a high and low boundary. A non-range is also acceptable provided is a number | 1 to 10 , 1-10 , 10+ , 10 |
gender | Gender of the consumer | Male , Female , Other , M , F , O |
phone | A US phone number in a common format (optional extension must be preceded by the x character). To specify the type of the phone number append h for home, w for work, or m for mobile to the number. |
1-512-789-1111 , 512-789-1111 x1234 , (512) 789-1111h , 5127891111m , (512) 789-1111w |
An email address | foo@bar.com , foo+bar@baz.com |
|
street | A street address | 4203 Guadalupe St |
trustedform_url | A TrustedForm certificate or ping URL | https://cert.trustedform.com/eb9fc4dd9bed9ad451a5648946cf4bf09b5bb947 |
url | A URL | https://mywebsite.com |