A Backlink is used to link a Variable in Advice text to the question where the user could modify the input.

Consider the following contrived example.

Asking the question

The API asks whether the user's income is above or below the IRS limit of $198,000.

Giving Advice

The API, after asking other necessary questions, continues with this straight-forward Advice:

Because your income is above $198,000, you are not eligible for a Roth IRA and should consider a Traditional IRA instead.

Using the HTML or AttributedString Advice content type, it is possible to build interactive interfaces allowing the user to refine their "income" answer directly from the Advice text.

If requesting HTML content, our API automatically includes HTML anchor <a> elements surrounding Backlink Variables producing text that looks like this:

Because your income is above $198,000, you are not eligible for a Roth IRA and should consider a Traditional IRA instead.

Inspecting the HTML

Inspecting an ADVICE item in the advice[] list, the following properties would be present. In the headline_html field, look for the <taffrail-var> HTML element nested inside an <a> anchor element.

{
  "headline": "Because your income is above $198,000, you are not eligible for a Roth IRA and should consider a Traditional IRA instead."
  "headline_html": "Because <a href=\"#Roth_Eligibility\" data-variable-id=\"EbAx0DxX9Bm490AALrEPV\" class=\"taffrail-var\"><taffrail-var data-variable-type=\"Freetext\" data-variable-name=\"Roth_Eligibility\" data-variable-id=\"EbAx0DxX9Bm490AALrEPV\" data-variable-raw-value=\"Income too high for a Roth\">your income is above <taffrail-var data-variable-type=\"Number\" data-variable-format=\"$0,0\" data-variable-name=\"IRS_Limit_Roth_MFJ_Income_Low\" data-variable-id=\"Bj09EXCZkhOiKxdsa4UaL\" data-variable-raw-value=\"198000\">$198,000<\/taffrail-var><\/taffrail-var><\/a>, you are not eligible for a Roth IRA and should consider a Traditional IRA instead.\n"
}

The <a> anchor element has a data-variable-id attribute to lookup which INPUT_REQUEST it belongs to as well as a pre-populated href attribute with the Variable name, e.g., #Roth_Eligibility.

The Variable ID attribute value maps to either the form.questionVariable.name or the form.name property, in that order, on an INPUT_REQUEST item in the advice[] list.

For simpler development, a taffrail-var class name is added to the <a> element indicating a nested <taffrail-var> element is contained within.

AttributedStrings

Use the AttributedString Advice content type to build your own interfaces with customized logic. Our API includes string attributions defining which text should be backlinked.

Look for the type: "backlink" property on an Attribution, and read more in Advice Content Types.

If you're developing an iOS or Android app, or using a programming framework with an AttributedString struct, this content type is for you.