How to pass variable data when using Widget Macro in Record Producers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2019 09:45 AM
Our team is developing in New York and have requirements to have a slush bucket variable render in Service Portal for a catalog item. We know that List Collector's render differently in Service Portal, but we need the slush bucket UI and the only way to do that it seems, is to create a Widget and pull it into the Record Producer as a Macro variable.
Our question is, once we create the widget, how does that new Macro variable communicate with the other variables on the Record Producer?
For example if we have a Macro variable for Users like this:
Followed by a Reference dropdown variable:
Once submitted, we want all the users selected from our custom Macro variable to have the same "type of award" selected from the Reference dropdown, but how do we make that happen?
Any suggestions are greatly appreciated!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2019 11:52 AM
You can create a List collector variable and map the values from your custom Widget to the newly created variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2019 12:48 PM
Hi dvp, can you explain that a bit more?
Right now our team has a Macro variable on a Record Producer that's calling a Widget that looks like this:
The code for the widget looks like this:
<form class="btn-group" id="example-reset-form">
<div class="btn-group">
<select id="example-reset" multiple="multiple">
<option ng-repeat="item in data.users track by $index" value="{{item.name}}">{{item.name}}</option>
</select>
<button type="reset" id="example-reset-button" class="btn btn-default">Reset</button>
</div>
</form>
(function() {
/* populate the 'data' object */
/* e.g., data.table = $sp.getValue('table'); */
data.users = [];
var gr = new GlideRecord('sys_user');
//gr.addQuery('pcs_coordinator', user_sysID);
//gr.orderBy('proposed_effective_date');
gr.query();
while(gr.next()) {
data.users.push({
name: gr.getValue('name')
});
}
})();
That Macro variable is mapped to a dummy field on a dummy table called u_slush_test:
However, when we test out the Record Producer and submit a bunch of names, nothing gets recorded in the table. Are we missing something to get this to work?
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2019 02:59 AM
You can try something like this in client controller
$scope.page.g_form.setValue('LIST_COLLECTOR_VARIABLE_NAME', c.data.HTML_INPUT_NAME);