- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2017 09:20 PM
Hello all,
So I am creating a UI page that requires a select box to become populated with values that are stored inside a custom table. The custom table
has a column that contains a 'choices field' with several different choices. I am wondering if there is a way to get an array of these values into the
jelly script and use it in the select box. An example would be lovely too.
Thank you for any help.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2017 02:46 PM
Here you go
<g:evaluate var="jvar_test" object="true" jelly="true">
var obj=[];
var gr= new GlideRecord('u_sales_order_ui');
gr.query();
while(gr.next()){
obj.push(gr.u_subcategory.toString());
}
obj;
</g:evaluate>
<select>
<j:forEach var="jvar_item" items="${jvar_test}">
<option value="${jvar_item}"> ${jvar_item} </option>
</j:forEach>
</select>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2017 02:38 PM
It is called Subcategory and has four different choices.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2017 02:38 PM
Sorry the table name is called u_sales_order_ui

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2017 02:39 PM
What is field name of it not the label and also the table name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2017 02:41 PM
The table name is u_sales_order_ui and column name is u_subcategory. Sorry I do not see a field name option.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2017 02:46 PM
Here you go
<g:evaluate var="jvar_test" object="true" jelly="true">
var obj=[];
var gr= new GlideRecord('u_sales_order_ui');
gr.query();
while(gr.next()){
obj.push(gr.u_subcategory.toString());
}
obj;
</g:evaluate>
<select>
<j:forEach var="jvar_item" items="${jvar_test}">
<option value="${jvar_item}"> ${jvar_item} </option>
</j:forEach>
</select>