---
schema_version: "1"
id: 0d4714dc0130abc3e72e5aacc2e05b84fd47a0778cfd8f1f0b590d8a0066267a
title: Create and Test Data Policies
collection: tableau
version: current
locale: en-gb
portal_url: https://docs.salesforce.com/tableau/current/en-gb/server-linux/ipa_vconn_create_data_policy.md
canonical_url: https://help.tableau.com/current/server-linux/en-gb/ipa_vconn_create_data_policy.htm
source_site: help.tableau.com
content_type: documentation
content_hash: b4cc0b64d2b7078d0a1658f278af12e3e43f333ea788d2790451dd575a7ac859
description: Quick help on creating and testing data policies in a virtual connection.
---
[Skip to main content](#main-content)

# Create and Test Data Policies

Use a data policy to filter data in any view, data source or flow that uses the virtual connection. Use a column in a policy table or an entitlement table to filter the data to only what a user should see.

- **Policy table** - the tables that are filtered.
- **Policy column** - column used to filter the data.
- **Entitlement table** - a table that includes a column you can use to filter the data. Use when policy tables don't include a policy column.

Add tables to the policy

To create a data policy:

1. Click ![Create New Policy button](/tableau/current/en-gb/server-linux/en-gb/Img/ipa_Create_New_Policy_btn.png)
2. Click the default name on the tab to rename the policy.
3. Double-click the table name in the left pane to add tables to the data policy.

[Read full topic](https://help.tableau.com/current/server-linux/en-gb/dm_vconn_create_conn.htm#select-tables-to-include-in-the-connection)

Map table columns

For each policy table, map a column in the policy table to either a policy column or an entitlement table.

### Map to a policy column

1. Click ![The Add Column to Map button.](/tableau/current/en-gb/server-linux/en-gb/Img/ipa_vconn_add_col_map_btn.png) to add one or more columns to use to filter data.
2. Name the policy column. You'll use this name in the policy condition.
3. For each policy table, use the drop-down menu to select the table column that maps to the policy column.
4. Repeat this process for as many policy columns as you want to use in the policy condition.

**Quick clip:** Map a table column to a policy column and write a policy condition for a data policy that filters invoices by Salesperson.

Your browser does not support the video tag.

[Read full topic](https://help.tableau.com/current/server-linux/en-gb/dm_vconn_create_rlspolicy.htm#filter-with-a-policy-column-from-a-policy-table)

### Map to an entitlement table

1. Select the entitlement table, drag it to the right and drop it on Add as Entitlement Table. You can use a table from any connection or database as a central entitlement table that secures tables across many other databases.
2. For each policy table, click the drop-down menu and select the columns to map the policy table to the entitlement table.

**Quick clip:** Map an entitlement table (with EmployeeID and Full Name columns) to policy table columns and write a policy condition for the data policy.

Your browser does not support the video tag.

[Read full topic](https://help.tableau.com/current/server-linux/en-gb/dm_vconn_create_rlspolicy.htm#filter-with-policy-column-from-an-entitlement-table)

Write a policy condition

A policy condition is a calculation that often uses a user function to define row-level access. More about [User Functions](https://help.tableau.com/current/pro/desktop/en-gb/functions_functions_user.htm) in help online.

A policy condition:

- Is required in a data policy.
- Must evaluate to true or false.
- Shows rows when the policy condition is true.

Example:

`FULLNAME() = [EmployeeName]`

[Read full topic](https://help.tableau.com/current/server-linux/en-gb/dm_vconn_create_rlspolicy.htm#write-a-policy-condition)

Test your data policy using Preview as user

Test your policy to see the data as the user sees it and ensure that your policy is working as expected.

1. Select a table.
2. In the Table Details section, select ![A tick box labelled "With policy applied".](/tableau/current/en-gb/server-linux/en-gb/Img/ipa_vconns_with_policy_applied.png)
3. Click Preview as user, select a Group (optional) and a User.
4. Verify the policy shows the correct data for that user in the table details.
5. Repeat for other users as needed.

[Read full topic](https://help.tableau.com/current/server-linux/en-gb/dm_vconn_test_preview.htm)

Publish the connection and set permissions

### Save a draft or publish a connection

Your connection is automatically saved as a draft while you work. Manually save the draft by clicking ![Save icon](/tableau/current/en-gb/server-linux/en-gb/Img/ipa_Save_16px_medium.png).

To share a new virtual connection with other users, you need to publish it.

1. Click ![Publish button](/tableau/current/en-gb/server-linux/en-gb/Img/ipa_vconn_publish_btn.png) in the upper right corner of the editor.
2. Type a name for the connection in the Name field.
3. Select a project to save the connection to.
4. Click ![Publish button](/tableau/current/en-gb/server-linux/en-gb/Img/ipa_vconn_publish_btn.png)

When you edit an existing connection, it remains available to users in its current published state.

- To save updates to a draft, click ![Save icon](/tableau/current/en-gb/server-linux/en-gb/Img/ipa_Save_16px_medium.png).
- To make the updated connection available to users, click ![Publish button](/tableau/current/en-gb/server-linux/en-gb/Img/ipa_vconn_publish_btn.png)

### Set permissions so others can use the connection

You've published the connection, and you're ready to let others use it. To do this, set the Connect capability to Allowed.

1. Navigate to the virtual connection.
2. Open the Actions menu (...) and click Permissions.
3. Select the box under the Connect icon so that connect is allowed for all users.
    
    ![Connect capability tick box under Permissions Rules](/tableau/current/en-gb/server-linux/en-gb/Img/ipa_vconn_connect_capability.png)
4. Click Save.

[Read publish and permissions topic](https://help.tableau.com/current/server-linux/en-gb/dm_vconn_publish_save.htm)

## Related tasks

[About the Virtual Connection Editor](https://help.tableau.com/current/server-linux/en-gb/ipa_vconn_about_editor.htm)

[Add Tables to the Connection](https://help.tableau.com/current/server-linux/en-gb/ipa_vconn_add_tables.htm)

[About Data Policies](https://help.tableau.com/current/server-linux/en-gb/ipa_vconn_about_data_policy.htm)

Not finding what you need?

Go online to see [all Tableau help](https://www.tableau.com/en-gb/support/help)