Adding a custom user property to a user’s log in account

You can create a custom user property and assign a value to a user's log in account to restrict what a user sees when logging into Klipfolio.

In this example, a custom user property called country is created for all user log in accounts and a value called Canada is assigned to a specific user log in account.

This example uses the DATASOURCE function. The DATASOURCE function allows you to use data in multiple data source files that is formatted in the same way. To determine the DATASOURCE id for a data source, see DATASOURCE function.

To build this Klip, you will;

  • Build a User Input Control component
  • Build a Table component
  • Use the DATASOURCE and SELECT functions in a formula

This Klip uses the following data sources:

To provide a list of data source ids and country names create a file in Microsoft Excel. To determine the DATASOURCE id for a data source, see DATASOURCE function.

Google Analytics data source for Canada.

Google Analytics data source for Australia.

Step 1: Building a User Input Control component

Note: If the column has a row header in your data source, you must wrap each column reference in the SLICE function. By default, the SLICE function removes the column or row header. For more information, see SLICE function.

  1. Select Build a New Klip.
  2. Select the User Input Control component.
  3. Select Use an existing data source from the library and select your data source.

Goal: Create a variable to use in the Table formula.

  1. From the component tree, select Klip, and type a Klip Title.
  2. From the component tree, select Drop-Down List.
  3. At the Properties panel, do the following:

Field

Required information

For our example

Control Label Enter a name for the drop-down list. Country selector
Create New Variable Enter a name for the variable. country
Scope Select a Scope.
Scope controls if a variable is active at the Klip, Dashboard or All Dashboards level.
Only this Dashboard
  1. From the component tree, select Values.
  2. From the formula editing toolbar, select the country - Column B - from the data source file.
  3. With column B:B selected, select Wrap current value in function, Data Manipulation, SLICE, to remove the row header.
  4. Save the Klip.

Step 2: Building columns in the Table component

Goal: Use the SELECT and DATASOURCE functions to select data from two different data sources files.

  1. Select Build a New Klip.
  2. Select the Table component.
  3. Select Use an existing data source from the library and select your data source file.
  4. Tip: You do not need to add the Google Analytics data source files as Klipfolio will use the data source ids.

  5. From the component tree, select Klip, and type a Klip Title.

Location

Action

For our example

From the component tree select Column: Unnamed 1.  
In the formula editing toolbar

select Insert function, ARRAY.
The ARRAY function allows you to type in your own text.

ARRAY ( data )
With data selected select Insert literal string or number, type newVisits, and click the Apply button. ARRAY ( "newVisits" , data )
With data selected select Insert literal string or number, type Visits, and click the Apply button. ARRAY ( "newVisits" , "Visits" , data )
From the component tree select Column: Unnamed 2.  
In the formula editing toolbar

select Insert function, Data Manipulation, SELECT.
The SELECT function allows you to return data that meets a specific condition.

SELECT ( data , ( condition ) )
With data selected select the column with the data source ids - column C.
This returns the data source ids for each selected country.
SELECT ( C:C , ( condition ) )
With condition selected select the column with the country names - column B. SELECT ( C:C , ( B:B ... ) )
With ... selected select the mathematical operator =. SELECT ( C:C , ( B:B =  ... ) )
With ... selected select Insert variable and select the variable you created earlier, i.e. country.
country = B:B allows you to select either Australia or Canada.
SELECT ( C:C , ( B:B =  country ... ) )
With SELECT selected select Wrap current value in function, Data Manipulation, DATASOURCE.
The DATASOURCE function uses the SELECT function to retrieve the data source ids.
DATASOURCE( SELECT( C:C ,( B:B = country ) ) , pointer )
With pointer selected select Insert literal string or number,, type A2:B2, and click the Apply button.
Pointer in the DATASOURCE function is responsible for retrieving the number of New Visits and Visits from each data source file.
DATASOURCE( SELECT( C:C ,( B:B = country ) ) , "A2:B2" )
  Name your columns using the Properties panel and Save the Klip.  

Step 3: Creating a custom user property

To create a custom user property and assign a value to a user's log in account use the following steps.

  1. Select the Users link.
  2. Tip: You must have administrative access to see the Users link.

  3. Select the Name of the user account you want to assign a custom value.
  4. Select Properties.
  5. Select Add New User Property.
  6. Enter the variable name in the Property Name box, e.g. country, and click the Create Property button.
  7. The custom property is created for all log in accounts.

  8. Click the undefined link for the property name you created.
  9. Enter the name of a value for this variable, e.g. Canada, in the User's Value box.
  10. Click the Close button.

You can now remove the User Input Control component from the dashboard as data is filtered by the value set in the user's log in account.

Feedback and Knowledge Base