Skip to main content
Skip table of contents

How to send User Input to a Data Source via a Variable

In this section, we'll show you how to use a variable to send a search term to a data source using Field Configuration (Extension Search External). This example can also be reproduced with a standard external search field, If you haven't installed the Extension yet. 

Prerequisites:

  • Example data source: Sample 2: Search Customer

  • Installed: External Data Extension when Extension is used. Default Search External can also be used in case Extension has not been installed.

 

Steps to Create a Variable:

We'll use the sample data source "Sample 2: Search Customer" and create a variable.

For the purpose of this demo, we have selected "Sample Data 2", as our data source, which we offer as part of the app for testing purposes. You can generate the demo sample in the settings tab.

  1. To do this, simply click on "Add Var" as shown below and name the variable as you see fits perfect. Here we are using {searchTerm} as our variable.
    In general, Variables are added within Curly Brackets. For eg. {searchTerm} where searchTerm is the name of the variable.

_Sample 2_Search Customer.png

 

  1. You can test the variable, in this case searchTerm by clicking on the "Test" option located in the Data Source Configuration. Try multiple values to make sure everything is working as expected.

Test Connection.png

 

  1. The next step is to add an "Extension Field" and subsequently a " Search External Field" under the "Field Configuration" tab. Then select the Sample 2 Data source which has search term variable to be used to transfer the user input.

Extension Search External.png

  1. Finish the rest of the field configuration as shown in the screenshot below.

Extension Search External JSONpath.png

 

  1. After setting up the configuration, you can test it directly within an Issue to ensure everything is working as expected. Start typing should filter down the result respective to the inputed value.

Field config in Issue.png

This example shows how to send the user input via variable to a data source and let the data source perform the search operation.


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.