URL Actions
A URL action is a hyperlink that points to a web page, file, or other web-based resource outside of Tableau. You can use URL actions to create an email or link to additional information about your data. To customize links based on your data, you can automatically enter field values as parameters in URLs.
Tip: URL actions can also open in a web page object in a dashboard. See Actions and Dashboards to learn more.
Open a web page with a URL action
- On a worksheet, select Worksheet > Actions. From a dashboard, select Dashboard > Actions.
- In the Actions dialog box, click Add Action and then select Go to URL.
-
In the next dialog box, enter a name for the action. To enter field variables in the name, click the Insert menu to the right of the Name box.
Note: Give the action a descriptive name, because the link text in the tooltip is the name of the action, not the URL. For example, when linking to more product details, a good name could be "Show More Details".
- Use the drop-down list to select a source sheet or data source. If you select a data source or dashboard you can select individual sheets within it.
-
Select how users will run the action.
If you choose this option... The action is run when the user... Hover Mouses over a mark in the view. This option works best for highlight actions within a dashboard. Select Clicks a mark in the view. This option works well for all types of actions. Menu Right-clicks (control-clicks on Mac) a selected mark in the view, then clicks an option in a tooltip (menu). This option works particularly well for URL actions. -
For URL Target, specify where the link will open:
- New Tab if No Web Page Object Exists — Ensures that the URL opens in a browser on sheets that lack web page objects. This is a good choice when Source Sheets is set to All or a data source.
- New Browser Tab — Opens in the default browser.
- Web Page Object — (Available only for dashboards with Web Page objects) Opens in the web page object you select.
Note: For New Tab options, the first time the action is run it opens a new tab. After that, the action will open in the same tab instead of opening additional ones.
- Enter a URL
- The URL should start with one of the following prefixes:
http
,https
,ftp
,mailto
,news
,gopher
,tsc
,tsl
,sms
, ortel
- Tableau Desktop also supports local paths like
C:\Example folder\example.txt
, as well as file URL actions. - To enter field and filter values as dynamic values in the URL, click the Insert menu to the right of the URL. Be aware that any referenced fields must be used in the view. For details, see Using field and filter values in URLs.
Note: If no prefix is entered,
http://
is automatically appended to the beginning and the URL action will work in Tableau Desktop. However, if a URL action with no prefix is published to Tableau Server or Tableau Cloud, it will fail in the browser. Always provide a fully qualified URL for actions if the dashboard will be published.Note: You can specify an ftp address only if the dashboard doesn't contain a web object. If a web object exists, the ftp address won't load.
- The URL should start with one of the following prefixes:
- (Optional) In the Data Values section, select any of the following options:
- Encode Data Values that URLs Do Not Support — Select this option if your data contains values with characters that browsers don't allow in URLs. For example, if one of your data values contains an ampersand, such as “Sales & Finance,” the ampersand must be translated into characters that your browser understands.
- Allow Multiple Values via URL Parameters — Select this option if you are
linking to a web page that can receive lists of values via parameters
in the URL. For example, say you select several products in a view
and you want to see each product’s details hosted on a webpage.
If the server can load multiple product details based on a list
of identifiers (product ID or product name), you could use multi-select
to send the list of identifiers as parameters.
When you allow multiple values, you must also define the delimiter escape character, which is the character that separates each item in the list (for example, a comma). You must also define the Delimiter Escape, which is used if the delimiter character is used in a data value.
Create an email with a URL action
- On a worksheet, select Worksheet > Actions. From a dashboard, select Dashboard > Actions.
- In the Actions dialog box, click Add Action, and select Go to URL.
- In the Source Sheets drop-down list, select the sheet that contains the field with the email addresses you want to send to.
- In the URL box, do the following:
- Type mailto:, and click the Insert menu at right to select the data field that contains email addresses.
- Type ?subject=, and enter text for the Subject line.
- Type &body=, and click the Insert menu at right to select the fields of information that you want to include in the body of the email.
In the example below, the “Email” field contains the email addresses, the subject is “City Information”, and the body text of the email consists of the city and state data that is associated with the email address.
:
-
(Optional) Display data from your workbook in the body of your email as a vertical list instead of the default horizontal list. For example, suppose you have a horizontal list of cities, such as Chicago, Paris, Barcelona, which you would rather display vertically, like this:
Chicago
Paris
BarcelonaTo make the list vertical, in the Data Values section, do the following:
- Deselect Encode Data Values that URLs Do Not Support
- Select Allow Multiple Values via URL Parameters.
- Type %0a in the Value Delimiter text box to add line breaks between each item in the list. (These are the URL-encoded characters for a line break.)
Using field and filter values in URLs
When users trigger URL actions from selected marks, Tableau can send field, filter, and parameter values as variables in the URL. For example, if a URL action links to a mapping website, you could insert the address field to automatically open the currently selected address on the website.
- In the Edit URL Action dialog box, begin typing the URL for the link.
- Place the cursor where you want to insert a field, parameter, or filter value.
- Click the Insert menu to the right of the text box and select the
field, parameter, or filter you want to insert. The variable appears within angle brackets. You can continue adding as many variables as you need.
Note: Any referenced fields must be used in the view. Otherwise, the link won't display in the viz, even if it functions when you click Test Link.
Including aggregated fields
The list of available fields includes only non-aggregated fields. To use aggregated field values as link parameters, first create a related calculated field, and add that field to the view. (If you don't need the calculated field in the visualization, drag it to Detail on the Marks card.)
Inserting parameter values
When inserting parameter values, URL actions send the Display As value by default. To instead send the actual value, add the characters ~na
after the parameter name.
For example, say you have a parameter that includes IP addresses, with Actual Value strings such as 10.1.1.195 and Display As strings with more friendly values such as Computer A (10.1.1.195)
. To send the actual value, you'd revise the parameter in the URL to look like this: http://<IPAddress~na>/page.htm
.