Autofill
Autofill allows you to apply saved values to a Herald application.
For example, imagine you're developing a tool for brokers who sell insurance to small businesses. You know that these businesses typically have websites, generate $500K in annual revenue, and have two employees. To save brokers time, you want these values to be automatically filled in when they start a new application.
As a developer, you can implement this feature by:
- Setting up an
autofill_profilecontaining the information above - Applying the
autofill_profileto new applications created on your platform
Create an autofill_profile
Start by using our POST /autofill_profiles to create your autofill_profile. We’ll use the content from the example above and call our profile “Small Business.”
{
"name": "Small Business",
"rules": [
{
"parameter_type": "risk",
"parameter_id": "rsk_k39d_number_of_employees",
"value": 2
},
{
"parameter_type": "risk",
"parameter_id": "rsk_vrb1_total_annual_revenue",
"value": 500000
},
{
"parameter_type": "risk",
"parameter_id": "rsk_7ahp_has_domain",
"value": "no"
}
]
}You might have noticed that our profile was created with a mistake! Since we have to submit all the values in the profile to update it, and we’ll need the ID, we can use GET /autofill_profiles to grab those values!
{
"pagination": {
"page": 1,
"limit": 25,
"total": 1
},
"autofill_profiles": [
{
"id": "f686160d-f6ba-4133-a67f-eae4634866e7",
"name": "Small Business",
"rules": [
{
"parameter_type": "risk",
"parameter_id": "rsk_k39d_number_of_employees",
"value": 2
},
{
"parameter_type": "risk",
"parameter_id": "rsk_vrb1_total_annual_revenue",
"value": 500000
},
{
"parameter_type": "risk",
"parameter_id": "rsk_7ahp_has_domain",
"value": "no"
}
]
}
]
}Now that you have your autofill_profile ID you can use PUT/autofill_profiles/{autofill_profile_id} to make the correction.
{
"name": "Small Business",
"rules": [
{
"parameter_type": "risk",
"parameter_id": "rsk_k39d_number_of_employees",
"value": 2
},
{
"parameter_type": "risk",
"parameter_id": "rsk_vrb1_total_annual_revenue",
"value": 500000
},
{
"parameter_type": "risk",
"parameter_id": "rsk_7ahp_has_domain",
"value": "yes"
}
]
}Apply an autofill_profile
Now that we have our “Small Business” autofill_profile we can use POST /applications/{application_id}/autofill to add these values to an application.
{
"autofill_profiles": [
"f686160d-f6ba-4133-a67f-eae4634866e7"
]
}You can make this call when any time, but autofill will never overwrite existing values. Here are a few scenarios to consider:
- A blank application will accept all values from the
autofill_profile - A partially filled out application will fill in only blank answers from the
autofill_profile - A application with answers to all questions will not accept any values from an
autofill_profile
Conditionality
Returning to the previous example let’s say you’re building an autofill_profile for only Jim’s Hoagie Shack franchises. You’re going to create a new profile with the same values as “Small Business” but you’d like to add the same website for all applications: www.jshoagieshack.biz. Let's assume you created this profile already and are checking your platform to get the ID for you new autofill_profile, "Small Business: Jim’s Hoagie Shack."
{
"pagination": {
"page": 1,
"limit": 25,
"total": 2
},
"autofill_profiles": [
{
"id": "f686160d-f6ba-4133-a67f-eae4634866e7",
"name": "Small Business",
"rules": [
{
"parameter_type": "risk",
"parameter_id": "rsk_k39d_number_of_employees",
"value": 2
},
{
"parameter_type": "risk",
"parameter_id": "rsk_vrb1_total_annual_revenue",
"value": 500000
},
{
"parameter_type": "risk",
"parameter_id": "rsk_7ahp_has_domain",
"value": "yes"
}
]
},
{
"id": "26932147-41f2-4979-b4cb-5b2b2258a1ec",
"name": "Small Business: Jim’s Hoagie Shack",
"rules": [
{
"parameter_type": "risk",
"parameter_id": "rsk_k39d_number_of_employees",
"value": 2
},
{
"parameter_type": "risk",
"parameter_id": "rsk_vrb1_total_annual_revenue",
"value": 500000
},
{
"parameter_type": "risk",
"parameter_id": "rsk_7ahp_has_domain",
"value": "yes"
},
{
"parameter_type": "risk",
"parameter_id": "rsk_dy7r_domain_names",
"value": "www.jshoagieshack.biz"
}
]
}
]
}Now, you have a second autofill_profile called "Small Business: Jim’s Hoagie Shack."
If you apply this autofill_profile to a blank application and then retrieve that application, it will now include the following parameters and values:
rsk_7ahp_has_domain: yes (pre-existing in the blank application)rsk_dy7r_domain_names: www.jshoagieshack.biz (added from the autofill profile)
Originally, the blank application only contained rsk_7ahp_has_domain. However, after applying the "Small Business: Jim’s Hoagie Shack" autofill profile, rsk_dy7r_domain_names is automatically populated, adding a parameter and a value to the application.
Now, let’s consider a third small business scenario: Bob’s Pizza franchises. In this case, all businesses share the same website, but only about half of the applicants use it.
To accommodate this, you need to create an autofill_profile that allows customers to specify whether they have a website. If they answer "yes", you want to provide the default value: "bobspizzapolluza.com".
Your autofill-profiles would look like this:
{
"pagination": {
"page": 1,
"limit": 25,
"total": 3
},
"autofill_profiles": [
{
"id": "f686160d-f6ba-4133-a67f-eae4634866e7",
"name": "Small Business",
"rules": [
{
"parameter_type": "risk",
"parameter_id": "rsk_k39d_number_of_employees",
"value": 2
},
{
"parameter_type": "risk",
"parameter_id": "rsk_vrb1_total_annual_revenue",
"value": 500000
},
{
"parameter_type": "risk",
"parameter_id": "rsk_7ahp_has_domain",
"value": "yes"
}
]
},
{
"id": "26932147-41f2-4979-b4cb-5b2b2258a1ec",
"name": "Small Business: Jim’s Hoagie Shack",
"rules": [
{
"parameter_type": "risk",
"parameter_id": "rsk_k39d_number_of_employees",
"value": 2
},
{
"parameter_type": "risk",
"parameter_id": "rsk_vrb1_total_annual_revenue",
"value": 500000
},
{
"parameter_type": "risk",
"parameter_id": "rsk_7ahp_has_domain",
"value": "yes"
},
{
"parameter_type": "risk",
"parameter_id": "rsk_dy7r_domain_names",
"value": "www.jshoagieshack.biz"
}
]
},
{
"id": "36432145-78f2-8674-b4hx-7e2u2258wq1ec",
"name": "Small Business: Bob's Pizza",
"rules": [
{
"parameter_type": "risk",
"parameter_id": "rsk_k39d_number_of_employees",
"value": 2
},
{
"parameter_type": "risk",
"parameter_id": "rsk_vrb1_total_annual_revenue",
"value": 500000
},
{
"parameter_type": "risk",
"parameter_id": "rsk_dy7r_domain_names",
"value": "bobspizzapolluza.com."
}
]
}
]
}To implement the experience for applicants you would call your autofill_profile "Small Business: Bob's Pizza" twice. First on the blank application. This would return values for rsk_k39d_number_of_employees and rsk_vrb1_total_annual_revenue. Then after the applicant answers rsk_7ahp_has_domain “yes,” you would call the autofill_profile "Small Business: Bob's Pizza” again to add the rsk_dy7r_domain_names “bobspizzapolluza.com” to the application.
Limitations
Herald does not yet support providing different answers based on previous responses. For example, "when revenue is over $500k then employee count is 500, otherwise employee count should be 50," is not supported yet.
Herald only provides this feature set for our applications. Some implementations of Herald use only our POST/ submissions endpoint. We do not yet support autofill-profiles for those implementations.