- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2022 05:21 AM
If i use this:
<g:evaluate var="jvar_myvar" jelly="true" object="true">
var inc = new GlideRecord('incident');
inc.setLimit('5');
inc.addQuery('active' , 'true');
inc.query();
inc;
</g:evaluate>
<j:while test="${jvar_myvar.next()}">
<button>${jvar_myvar.getValue('number')}</button>
</j:while>
i am able to create a Button for each GlideRecord Element.
Now i need a Solution to give that Buttons a Value and use this Value in the CS.
For Example:
I have 5 Buttons with there Incident Numbers.
Each Numbers should also be the Value of each Button
And if i click on one of these Button, the Value should be written in a Field on the Incident Form.
Without the Value, the Button appears with the Groupname (its another example)
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2022 06:09 AM
I think the issue may be elsewhere... Let me take a jab now.
Replace your button code with this:
<button type="button" onclick="updateField('${jvar_group_buttons.getValue('sys_id')}')">${jvar_group_buttons.getDisplayValue('group')}</button>
The assignment group is a reference field and only loves sysid.
Edit : ADDED THE TYPE ATTRIBUTE TO THE BUTTON and changed value to sys id
This should work!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2022 05:48 AM
Ha! Found you again!
In your screenshot, line 37, use quotes for the value attribute.
value="${jvar_group_buttons.getDisplayValue('group')}"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2022 05:53 AM
And rather than holding the value in the "value" attribute , you could directly pass it to your client script:
<button onclick="updateField('${jvar_group_buttons.getDisplayValue('group')}')">${jvar_group_buttons.getDisplayValue('group')}</button>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2022 05:56 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2022 06:00 AM
Hmm... Could you tell me how you are calling your UI page?
and also the start to end of what you are trying to do...