Autofill
Autofill allows you to apply saved values to a Herald application.
For example: you are building a tool for a group of brokers who sell insurance to small businesses. You know some key facts: these businesses have websites, they have revenue $500k per year, and 2 employees. When a broker starts an application you’d like these values to be filled in to save them time.
To support this type of feature as a developer you would
- Set up an [.h-code]autofill_profile[.h-code] containing the information above
- Apply your [.h-code]autofill_profile[.h-code] to new applications set up 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 autofill_profile. We’ll use the content from the example above and call our profile “Small Business.”
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!
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] is the endpoint to make the correction.
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.
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. You already know how to create profiles, so let’s just take a look at all the profiles on your platform now:
Now you have a second [.h-code]autofill_profile[.h-code] called “Small Business: Jim’s Hoagie Shack.” If you call that profile for a blank application and then retrieve that application, it will contain parameters and values for website (yes), and domain (www.jshoagieshack.biz). The blank application when created only contained a parameter for website.
Now let’s say you have a third type of scenario. Bob’s Pizza where all businesses have the same website, but that website is only used by about half of respondents. You want to build an [.h-code]autofill_profile[.h-code] that will allow customers to answer either yes or no to having a website. If they answer yes, you will provide a default value of “bobspizzapolluza.com.” Your autofill-profiles would look like this:
To implement the experience for applicants you would call your [.h-code]autofill_profile [.h-code] 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 else 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.