Mobile SDK - Prefilling Lead Data

This page describes how to prefill any user data you already have into your Mobile SDK implementation

Here is a screenshot of a sample code snippet of how you might implement the Mobile SDK into your app, with all prefilledData fields populated:

For your convenience, the same code snippet is pasted below as text, so you can copy-paste the bulk of the code. Please wrap the following snippet in a self closing < and />, following the screenshot above (the text below omits the wrapping </> so as not to trigger a CSS attack warning on this page).

PrefilledData example

The prefilledData object should be structured with any fields you want the user not to have to answer themselves, if you already have that info available. Here is an example of prefilledData as a Javascript Object. You may prefill as many of these fields as desired; the only 3 required are firstName, lastName, and email.

For any of these fields, DO NOT prefill any fields that are empty or otherwise unavailable. If you do not have info for a particular field available to prefill, omit that field in your prefilledDataobject.

For example, this is incorrect:

{..."firstName": "Bob", "lastName": "Dylan", "address": {}, ...otherAttributes}

// empty address is prefilled, which prevents the user from submitting complete info, and they will not receive offers

This is correct:

{"firstName": "Bob", "lastName": "Dylan", ...otherAttributes}

//address is not prefilled, which forces the user to input their address in the UI and will allow them to submit complete info and be considered for offers

PrefilledData type validations

The data should follow a type schema, described here in Typescript notation:

defaultSliderLoanAmount

By default, the requested loan amount slider defaults to a $5,000 loan amount. You may prefill the loanAmount if you know how much the user is requesting. If you do not know the exact amount but want to specify any other default amount (e.g. $7,500 instead of $5,000), use the defaultSliderLoanAmount attribute.

You may prefill both loanAmount and defaultSliderLoanAmount, for cases where you know the desired request amount for some users but not others. E.g. for Lead A, you know they want to request $10,000, but for Lead B, you do not know their desired loan amount, and want to default to $7,500. In this case, you can specify both loanAmount: ${loanAmountWhenAvailable} and defaultSliderLoanAmount: 7500. This will prefill the loanAmount if provided by your code, and otherwise will show the lead the default request amount in the slider during that step.

Enums / accepted values for certain fields

Certain fields, although strings, must be within a predetermined list of accepted values. Here are those values:

PrefilledData sanitization

Prefilled Data must align with the type validations above, and any fields with an accepted value enum must be within that enum. If you (the partner) prefill user data, and any type/value is invalid, that attribute will be stripped, and the lead will have to enter it again manually.

Prefilled values cannot be edited

Prefilled values cannot be edited by the user on the final confirm-details screen (before submitting the form). If the user's info is incorrect (e.g. Address is incorrect outdated), the user should edit the info in your app directly.

Last updated

Was this helpful?