In a catalog item, is there anyway to mimic an excel like table?

D Dejesus
Tera Contributor

I've run into a recurring problem when converting 'paper' forms into catalog items, in that many times a variable numbered, but repeating set of elements needs capturing. I'm rather new to ServiceNow, and was wondering if I'm just ignorant of a solution, but is there anyway to mimic table like functionality?

Meaning...

  • Have multiple defined columns of mixed variable types (single line, check box, yes/no drop down)
  • All information is written in by the user, nothing is stored in db tables anywhere
  • Making at least 1 full row mandatory
  • Allowing the option for multiple rows to be filled in and seen on the request item after submit

Even being able to just repeat a container full of variables at the press of a button would probably work. Filling out the same form multiple times is not really an option, and I worry that the only real solution here is attaching a spread sheet to fill out to the catalog item.

1 ACCEPTED SOLUTION

TrevorK
Kilo Sage

What Nathan has said above is our experience - you can use a UI Page to create a table that allows you all the flexibility in the world, but the challenge is that the UI Page variables are not (by default) saved with the other variables so when you display the "Variable Editor" within your Requested Item / Task, the values do not appear. This is why the SN Grid solution saves them to a Related List - so that they can appear.



We went back and did something slightly different because we wanted to use the Variable Editor. We have created a couple small tables like this with a fixed number of rows:


find_real_file.png


Each field is it's own variable and it uses out of the box functionality (we use a client script to hide the labels for the fields). That said, I cannot see why you could not have a button to show or hide each of the roles to mimic what you are looking for in a very low tech way. The advantage is that these fields will show up in the Variable Editor in the Requested Item. While we have used UI Pages in some spots, it only works in spots where the Variable Editor is not used (we just put the table details into the Description or Work Notes).



If you can come up with something more glamorous I am definitely interested in hearing it because we do a lot of form conversion as well and this is our challenge. So please share!


View solution in original post

13 REPLIES 13

Nate23
Mega Guru

There is a very customized solution I have used created by Oscar Lopez he calls the SN Grid, it uses a ui page that generates your columns and the user can add rows and clear them. on submit you can have the req show a related list that shows the line items they created in the grid. This solution is very customized though.


TrevorK
Kilo Sage

What Nathan has said above is our experience - you can use a UI Page to create a table that allows you all the flexibility in the world, but the challenge is that the UI Page variables are not (by default) saved with the other variables so when you display the "Variable Editor" within your Requested Item / Task, the values do not appear. This is why the SN Grid solution saves them to a Related List - so that they can appear.



We went back and did something slightly different because we wanted to use the Variable Editor. We have created a couple small tables like this with a fixed number of rows:


find_real_file.png


Each field is it's own variable and it uses out of the box functionality (we use a client script to hide the labels for the fields). That said, I cannot see why you could not have a button to show or hide each of the roles to mimic what you are looking for in a very low tech way. The advantage is that these fields will show up in the Variable Editor in the Requested Item. While we have used UI Pages in some spots, it only works in spots where the Variable Editor is not used (we just put the table details into the Description or Work Notes).



If you can come up with something more glamorous I am definitely interested in hearing it because we do a lot of form conversion as well and this is our challenge. So please share!


I believe you can also use an embedded list now too instead of a related list on the RITM. Just another added bonus to the SNGrid.


While I've been successful in learning and implementing a UI Page and the html table, capturing the input after clicking the standard Order Now button is proving frustrating.



Capture1.PNG



There is some core concept I'm not getting, likely due to how new I am at jelly scripts. I'm currently attempting to get the data via a catalog client script, which I'm fairly sure is the wrong approach.



I was wondering if you could go into a little bit more detail on how you used standard variables, as I'm not seeing much in the way of tutorials on the subject, or point me towards some reading that can help me understand the embedded list better.




EDIT:


Seems my problem was actually less service now and client scripts, and more a basic html table problem. In my Catalog Client Script I wasn't accessing the cells children properly.



That said I'm still not sure if doing this via javascript in a catalog client script and saving the output into a previously hidden multi-line variable is even close to best practice, and I'd love to know if there are better more future proof ways to handle this.