Welcome To Our Customer Service Portal


How do I dynamically push custom variables into Nanorep using an API?

The following API allows you to dynamically push custom variables into Nanorep:

_nRepData["customParams"] =

{

    paramName: "stringValue",

    paramName2: intValue
 

};

Example:

_nRepData["customParams"] =

{

    AvailableColors: "Red, Blue, Orange",

    Price: 500
};

Note: The API code must be placed below the /*API Here*/ comment as part of the widget code snippet.

 

Displaying variables values in Nanorep answers:

When editing a Nanorep article, You can use the following syntax to pull the variable value:

{{paramName}}

Example:

The weight is {{weight}}.

Notes:

1) If the variable does not exist (i.e. no API call was made for that variable) at the time the question is asked - Nanorep will not show this answer in the search results, and instead this will be considered as no-result.

2) There is an option to set a default value to the parameter. This will guarantee that the answer will be visible even if a variable was not found.

Syntax:

{{paramName:default}}

Example:

The weight is {{weight:100}}.