Digital-Clay objects such as dashboards, lists, graphs, charts, analysis tables, document templates, etc as well as any document saved in Clay, may be shared with other users via a URL if Web ClayStation is installed.
To get a URL for these objects, either use the 'Share…' functionality when the object or query is open, and check the 'Get Web/Widget URL' option, or, you can get URLs for existing shared objects via the Document Repository using the 'Get Web/Widget URL' functionality in the list of repository items.
Note that the 'URL for Web ClayStation' ClayCentral setting must be set for this to work, which provides the base Web URL for the above document URLs.
This URL can be sent to other users (as long as they have access to Web ClayStation via their web browser), and, by default, they will be asked to login before they can open the query/item you sent them. Once they login they may open multiple Digital-Clay shared objects, and their login session will only time-out after a period of inactivity. For logging in the user automatically using the URL itself, see below.
These URLs can be sent via e-mail or any collaboration tool, or they can be embedded inside documents and web pages. So, for example, web sites and portals maymake use of these URLs just like any other URL:
These embedded Clay widgets can be combined with REST API or Data Injection for entering data into Digital-Clay, thus allowing customers to build their own application or interfaces that combine easily-built native Clay objects (like dashboards) together with custom programming.
All of the objects mentioned above such as dashboards or lists may contain dynamic filters, which ask the user for filter values before running the query(s). You can programmatically fill these filter values instead having Clay ask the user, for any of the following reasons:
To do this, set your filters as dynamic filters when sharing the object as usual, then append the 'uf' parameter to the shared URL. Example:
http://myhomepage.com/clay.dcw/?r=12&aid=2100025214&uf=87:27:0-0
The filter value syntax is as follows:
uf=LinkGroupID1:FieldID1:value1,value2,...;LinkGroupID2:FieldID2:value1,value2...;etc.
The LinkGroupID is mandatory per filter. You can look up Link Group IDs in the Custom Links tool in ClayStudio.
The FieldID is only needed if you are filtering on a specific field rather than the LinkGroup itself. Examples:
Filter values for Link Groups and Linked Fields must be internal record IDs, not name fields. These IDs can be viewed by adding them to Digital-Clay Custom Functions using the 'ID' field. This allows precise filtering even when there are duplicate names, but it can only work if you know the ID beforehand, or if you add a list of IDs into the user's interface. If this is inconvenient, or if you want to search simply based on the name of the record, then you must add the Name field for that record as the filter. For example, to filter based on the Creator' Last Name, use: “3:6:Smith” where '3' is the LinkGroupID for 'Creator', and '6' is the Last Name field ID.
Numeric, Currency and Percentage fields must be filtered using a range of “minimum-maximum”. If you want to filter based on a maximum value of 100, use 0-100. For only a minimum value, simply add a large value for the maximum value such as 100-999999. Example: To search for Opportunities with Estimated Costs of exactly $1000 or $2000, use “87:27:1000-1000,2000-2000”.
Duration fields must also be filtered using a range of minutes. E.g. for 2-3 hours, use “120-180”.
Date fields must also be filtered based on a numeric range, and should be in Unixtime format (number of seconds since 1-Jan-1970).
Text filters are by default filtered with the 'Contains' comparator. To use a different comparator, add the comparator prefix “@@” and a constant number, as follows:
For example, to search for all Customers with the exact name of IBM, use: “17:1:@@1IBM”.
Multiple filters are concatenated with a semi-colon (e.g. “uf=87:27:1000-1000,2000-2000;17:1:IBM”)
If you wish to use the separators ; , or : inside your filter values, escape them with a backslash (\) character.
The above URL parameter allows one to load a Digital-Clay list, graph, dashboard, etc with custom filter values as part of the URL. However, it is also very useful to be able to change the filter values of the embedded Clay web object via a web interface on-the-fly. Although the search box may reload the embedded Clay web object every time a new value is entered, the issue here is one of performance. I.e. ideally, we only want to refresh the displayed data with the new filter value without reloading the page every time. This can be done by calling the javascript refreshExternal() function on the embedded iframe, instead of reloading the whole page/iframe.
Here is a simple example that displays a search box, a button for applying the filter, and an embedded iframe containing the clay web object, in this case a list shared in the Repository with a dynamic filter on the “Name Keyword” built-in filter (43):
<INPUT ID="val" TYPE="Text"><INPUT TYPE="Button" Value="Filter" onclick="filt();"><BR>
<IFRAME ID="clay" SRC="" STYLE="width:100%;height:300px;"></IFRAME>
<SCRIPT>
var firstTime=true;
function filt(){
var clay=document.getElementById("clay");
var val=document.getElementById("val").value;
if (firstTime) clay.src="http://myip.com/clay.dcw?r=12&aid=12345&uf=43::"+val;
else clay.contentWindow.refreshExternal("43::"+val);
firstTime=false;
}
</SCRIPT>
This basic code sets the URL of the iframe the first time the user searches for a name, and then calls the function with the new filter value on every subsequent search.
Note that this functionality does not work with Document Templates with dynamic filters. In this case the URL must be reloaded.
Normally, the user has to login to the system the first time they access any Web-ClayStation page. If this is the first time the user accesses the page, or if the user-session expired, then a Login page will display where they can enter a username and password, after which the original requested page will load.
But there is also an option to login the user automatically with a default username and password using the u/p parameters. (e.g. mysite.com/clay.dcw/?r=12&aid=2100025214&u=john&p=john123).
There is also an option to automatically login the user via a Role for pseudo-anonymous access. I.e. for the user there will be no login and the user will not exist in the system, but they login anyways by assigning a user from a pool of users given a specific role. This works as follows:
To login anonymously using a Role, use role:RoleName as the username. (e.g. myhomepage.com/clay.dcw/?r=12&aid=2100025214&u=role:webuser).
Lists, graphs, charts, analysis tables and other components may all be opened by default in 'full-screen' mode, to force the content to take up the full size of the browser window without buttons and other components surrounding it. To do this, add fs=1 to the URL (e.g. myhomepage.com/clay.dcw/?r=12&aid=2100025214&fs=1).