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:

  1. Setting up an [.h-code]autofill_profile[.h-code] containing the information above
  2. Applying the [.h-code]autofill_profile[.h-code] to new applications created on your platform

Create an autofill_profile

Start by using our [.h-code]POST[.h-code] [.h-endpoint-link]/autofill_profiles[.h-endpoint-link] to create your [.h-code]autofill_profile[.h-code]. We’ll use the content from the example above and call our profile “Small Business.”

POST /autofill_profiles
Copied

{
  "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 [.h-code]GET[.h-code] [.h-endpoint-link]/autofill_profiles[.h-endpoint-link] to grab those values!

GET /autofill_profiles
Copied

{
  "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 [.h-code]autofill_profile[.h-code] ID you can use [.h-code]PUT[.h-code][.h-endpoint-link]/autofill_profiles/{autofill_profile_id}[.h-endpoint-link] to make the correction.

PUT /autofill_profiles/{autofill_profile_id}
Copied

{
  "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” [.h-code]autofill_profile[.h-code]  we can use  [.h-code] POST[.h-code]  [.h-endpoint-link]/applications/{application_id}/autofill[.h-endpoint-link] to add these values to an application.

POST /applications/{application_id}/autofill
Copied

{
  "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:

  1. A blank application will accept all values from the [.h-code]autofill_profile[.h-code]
  2. A partially filled out application will fill in only blank answers from the [.h-code]autofill_profile[.h-code] 
  3. A application with answers to all questions will not accept any values from an [.h-code]autofill_profile[.h-code] 

Conditionality

Returning to the previous example let’s say you’re building an [.h-code]autofill_profile[.h-code] 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  [.h-code]autofill_profile[.h-code], "Small Business: Jim’s Hoagie Shack."

GET /autofill_profiles
Copied

{
  "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 [.h-code]autofill_profile[.h-code] called "Small Business: Jim’s Hoagie Shack."

If you apply this [.h-code]autofill_profile[.h-code] to a blank application and then retrieve that application, it will now include the following parameters and values:

  • [.h-code]rsk_7ahp_has_domain[.h-code]: yes (pre-existing in the blank application)
  • [.h-code] rsk_dy7r_domain_names[.h-code]: www.jshoagieshack.biz (added from the autofill profile)

Originally, the blank application only contained [.h-code]rsk_7ahp_has_domain[.h-code]. However, after applying the "Small Business: Jim’s Hoagie Shack" autofill profile, [.h-code] rsk_dy7r_domain_names[.h-code] 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:

GET /autofill_profiles
Copied

{
  "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  [.h-code]autofill_profile [.h-code] "Small Business: Bob's Pizza" twice. First on the blank application. This would return values for [.h-code]rsk_k39d_number_of_employees[.h-code] and [.h-code]rsk_vrb1_total_annual_revenue[.h-code]. Then after the applicant answers [.h-code]rsk_7ahp_has_domain[.h-code] “yes,” you would call the [.h-code]autofill_profile [.h-code] "Small Business: Bob's Pizza” again to add the [.h-code] rsk_dy7r_domain_names[.h-code] “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/ [.h-endpoint-link]submissions[.h-endpoint-link] endpoint. We do not yet support autofill-profiles for those implementations.