How to leverage URL and Email Attributes in Actions
Actions can be used to take advantage of columns that contain website URLs or email addresses. In this sample dataset, I have both features.
Actions can be created in the Discover module and in the Present module. If you are adding the Action in the Discover module, you will find the Actions button on the Design toolbar.
If you are adding the Action in the Present module, you will find the Actions button on the Component toolbar.
In order to use these fields, include them in your model and add them to a report. Click on the Actions button to open up the Actions Panel and the plus sign (+) to create the action. Set the Trigger Element to Hierarchy and the Action To Do drop-down to Jump To Url. Normally when using the Jump to URL, you will use PQL to construct the URL using a URL prefix and the context of the query. For example, "http://en.wikipedia.org/wiki/" + captions(). However, when grabbing the full URL from the caption, you will need to perform a URL decode of the value in order to get it to work in Pyramid. If you don’t decode it, it will look something like this when you click on the action:
<mypyramidserver>.com/http%3A%2F%2Fwww.boeing.com%2F
Add the UrlDecode function to the PQL expression to get it to work. It will pass the URL exactly as-is from the caption. Here is a sample of the code needed:
UrlDecode(captions("[Data].[URL]"))
For email addresses, you want to take advantage of the mailto keyword in HTML. Click on the Actions button to open up the Actions Panel and the plus sign (+) to create the action. Set the Trigger Element to Hierarchy and the Action To Do drop-down to Jump To Url. Set the Hierarchy drop-down to the Email attribute. In the URL, add the following code:
"mailto:"+captions()
Reply
Content aside
- 5 yrs agoLast active
- 205Views
- 3 Following