Tabular format in service catalog

SudhirOjha
Mega Guru

Any idea how can we create this type of form based on a table.

find_real_file.png

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Sudhir,



You need to have <table> tag and have the headers as fix.


From client script query the table you want and populate the column data.



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

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Sudhir,



As part of example following is the code.


It queries incident table with priority and has 3 columns and shows data for those records as table rows.



Obviously you can add css style etc for the table but the basic purpose is solved.



UI Page



HTML Section:



<?xml version="1.0" encoding="utf-8" ?>


<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">



      <html>


      <g:evaluate object="true">


              var inc = new GlideRecord('incident');


              inc.addQuery('priority',5);


              inc.query();


              inc;


      </g:evaluate>      


             


              <table border="1">


              <tr>


      <td>Number</td>


      <td>Short Description</td>


      <td>Category</td>


  </tr>


                     


              <j:while test="${inc.next()}">


                      <tr>


                              <td>${inc.number}</td>


                              <td>${inc.short_description}</td>


                              <td>${inc.category}</td>


                              </tr>


</j:while>      


              </table>      


      </html>      


</j:jelly>



screenshot below:



ui page.JPG



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

Thanks Ankur, But i am looking for data entry. Like the person can add data in tabular format.


and save button should work to submit all the data in the table.



any idea if this also can be done


Hi Sudhir,



Then in that case you need to have input type=text and using DOM manipulation get the values and insert in your custom table.



As an alternative you can use Catalog Table Variable which helps to achieve the same.



But this update set is not available directly.



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