Type 'list' in UI Page instead of reference field

neetika
Tera Contributor

Hi All,

I want a list field in UI page .

For now, I have created a reference field in UI Page :

g:ui_reference name="my_approvers" query="type=a77ffd0b0fa8b2006ad03e7ce1050ead" id="u_name" table="sys_user_group" style="width:180px"/>

I want to change it to List field(just like watch list field)

Please tell how can we change the above code to display the field of type 'list'

17 REPLIES 17

Abhishek Raj3
Tera Guru

Hi Neetika,



These are a list of available jelly tags that we can use in ui page servicenow:



  • <g:ui_table>           Put a table element on form
  • <g:ui_spacer pixels="6"/> Put a span element on form with margin = <pixels>
  • <g:ui_timezone_changer />               Display a select list of available time zones
  • <g:ui_update_set_picker />               Display a select list of available update sets
  • <g:ui_slushbucket up_down="true"/> Display a slushbucket with Add and Remove controls
  • <g2:ui_select_option text="text" value="value" />           Display an option element with specified text and value
  • <g:ui_checkbox name="new_checkbox" value="true"/>       Simple checkbox
  • <g:ui_button action="save">${gs.getMessage('Save')}</g:ui_button>       Button
  • <g:ui_date name="project_start_date" value="${sysparm_start_date}" />   Date picker
  • <g:ui_date_time name="project_start_date" value="${jvar_start_date}"/>       DateTime picker
  • <g:ui_input_field name="name" label="Name" value="value" size="100" />       Input field
  • <g:ui_multiline_input_field name="message" label="Message" value="value" rows="5" /> Multiline Input
  • <g:ui_choicelist class="form-control" name="myquantity" table="item" field="quantity" />   Choice list for a field from a table
  • <g:ui_progress_worker worker_id="${sysparm_pworker_sysid}" show_cancel="false" rows="grow"/> Display a progress bar


  • Display a reference table

              <g:ui_reference name="parent_id" id="parent_id" table="pm_project" query="active=true"           completer="AJAXTableCompleter" columns="project_manager;short_description" orderby="orderby"/>


  • Display a choice list for custom options

              <g:ui_choice_input_field id="table_name_choice" name="table_name_choice" for="table_name_choice" label="${gs.getMessage('Table')}" mandatory="true">                           <option value="none">${gs.getMessage('-- None --')}</option>                           <option value="1">value 1</option>           </g:ui_choice_input_field>          


  • Form with buttons OK and Cancel

          <g:ui_form onsubmit="return callback('ok');">


                      ...


                      <g:dialog_buttons_ok_cancel ok="return true" />


          </g:ui_form>  



I believe we dont have any OOB jelly tag that we can use as watchlist.



Thanks,


Abhishek


If there is no OOB Jelly Tag , is there any way we can implement that?


Also, I found one way of displaying a glide_list by calling UI Macro.



<g:macro_invoke macro= "lightweight_glide_list" id="u_name" name="my_approvers" control_name="myListCollector" reference="sys_user_group" query="type=a77ffd0b0fa8b2006ad03e7ce1050ead" can_write="true" />



But this is fetching all values from sys_user_group not bases on my query criteria- query="type=a77ffd0b0fa8b2006ad03e7ce1050ead"



I want the values for some particular type.


Ankur Bawiskar
Tera Patron
Tera Patron

Hi Neetika,



Following macro you can invoke:


<g:macro_invoke macro= "lightweight_glide_list" id="change_subsystem" name="change_subsystem" control_name="myListCollector" reference="core_company" can_write="true" />



in reference give table name. not sure whether query can be applied here or not.



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader