How do I add a search field to a Klip?

This article describes how to create a Klip where you can type a name into a search field and then click a button to display only the data related to that name.

The end-result is a Klip that looks something like this:

Read on to see how we created the example above or watch this video for a similar example.

To create a Klip with a text search field, you:

Create the data source

First you need a simple data source. For our example, we created a .csv file that includes names and values, in two separate columns, and then uploaded it from our desktop.

To create a data source using an uploaded file:

  1. Click Data Sources in the left navigation sidebar.
  2. Click Create a New Data Source and select Upload a File.

  1. Click Browse and select a file to upload.
  2. Click Get data.
  3. Ensure this is the data you’re looking for and click Continue.
  4. Name and Save your data source.
  5. On the About this Data Source page, click Create a Klip.

Build the Klip

When building your Klip, you will add a User Input Control, that contains a variable, and a table.

To build your Klip:

  1. In the Klip Editor, drag and drop a User Input Control component (see below) into your Klip preview workspace. (This will become your search/text field in the finished Klip.)

  1. In the Properties panel:
  • At Control Label, enter the action you want the user to perform. (We entered “Type a name”.)
  • At Control Type, select Text Field from the drop-down options.
  • At Use Variable, click New Variable.
  1. In the Create new variable window, enter a Variable Name (we used “find”) and a Klip Editor Value, where you enter one of the names from your data source (we chose the name “Renaldo” from our data source).  (In step #3, where you associate the variable with your data source,  this default value will display in the Klip preview.)
  2. Click Create Variable.
  3. In the Properties panel, at Scope, select Only this Klip from the drop-down options. Choosing this option ensures the variable will only be used for this Klip.
  4. Drag and drop a Table component into your Klip preview window, under the User Input Control you added earlier.
  5. To populate the table, click the first column in the table and then click the first column in your data source (the one that contains the names). Then click the second column in the table and click the second column in your data source (the one that includes the values).
  6. Remove the unnecessary third and fourth columns from the table by right-clicking each column and selecting Delete Column.
  7. Select each table column and, in the Properties panel, at Column Header, give them each a name. (We used “Sales Rep Name” for column 1 and “Sales” for column 2.)
  8. In the Properties panel, for the second column (“Sales”), at Results Row, click Sum.

Associate the variable with the data source

Next you will associate the variable you created earlier (“find”) with the text data in your data source.

To associate the variable with your data source:

  1. In the component tree, under Table, click the 3-dot menu beside the Sales Rep Name column and click Filter.

  1. In the Filter window, select Condition, and then choose either Matches or Contains (this varies depending on the data source you’re using) and select the variable name (“find”).
  2. Click Filter.

Note that the default name you entered earlier now displays in the Klip preview, as below.

Add the button component

As a final step, we will add the button component to the Klip and associate it with the user input control component you added earlier. Adding a button is important if you are using a large data source. Klipfolio performs a search every time you enter a character into the text box. However, if you add a button, the search only happens after the button is clicked, so the results are returned faster.

To add the button component and associate it with the user input control component:

  1. Drag and drop the Button component into the Klip preview window, under the text (“Type a name”) field.
  2. Note that, in the Properties panel, you can,optionally, override the default button background, border, and text colors.
  3. Select the User Input Control in the component tree.

  1. In the Properties panel, at Set Value, select On button press, and at Use Button, select Button.
  2. Click Save.
  3. Name and Save your Klip.
  4. Add the Klip to a dashboard. (After saving the Klip, you will end up on the Klips list page, where you can click the link for the Klip you just created, and then click Add to Dashboard).
  5. Test your Klip by entering a valid name into the text field and clicking the button to verify it returns the related data you expected.

Learn more

Have more questions? Submit a request