Here's what you can try:
- Create two blank text variables, we'll call them token1 and token2.
- Initialize the widget with the code from the "How to use..." page.
- Write any field value to the table using the CloudSet('field', 'value'); function. At this point, you will have the user token for table 1 in the variable stencilusertoken.
- Save user token to token1:
var player = GetPlayer();
player.SetVar('token1', player.GetVar('stencilusertoken'));
- Switch to table 2 (in the string below replace XXX with strings from the "How to use..." code for table 2):
var player = GetPlayer();
player.SetVar('stencilusertoken',player.GetVar('token2'));
window.baseurl = 'https://cluelabs.com/stencil/display/widget-data-cloud?v=XXX&chart=XXX';
- Write any field value to table 2 using the CloudSet('field', 'value'); function. At this point, you will have the user token for table 2 in the variable stencilusertoken.
- Save the value of stencilusertoken to variable token2.
var player = GetPlayer();
player.SetVar('token2', player.GetVar('stencilusertoken'));
- You can continue switching back and forth between the tables by overwriting stencilusertoken and the base URL:
var player = GetPlayer();
player.SetVar('stencilusertoken',player.GetVar('tokenX'));
window.baseurl = 'https://cluelabs.com/stencil/display/widget-data-cloud?v=XXX&chart=XXX';
If you need to keep track of which rows in table 1 correlate with which rows in table 2, consider getting the user id from table 1 with
CloudMeta('idthis', 'variable'); and then saving this value as one of the data fields in table 2.