Catalog Item HTML Variable

Ken83
Mega Guru

Hello Community,

I have been trying to find the best way to add dynamic fields to a Catalog Item form for users to input information. Since SN does not come with this functionality OOB, I had to dream up a way to accomplish it. My solution is a combination of things including a UI Macro on the form which is just a button.

2015-08-17 17_08_52-ServiceNow Service Automation - Opera.png

The button will trigger a UI page to popup in a GlideDialogWindow.This is how I am capturing input from the user. The dropdowns are populated via GlideAjax and transferred back to the form(in the HTML variable) upon closing the popup.


2015-08-17 17_10_02-ServiceNow Service Automation - Opera.png

Upon closing this pop up, the data is transferred back to the form in the HTML variable.

2015-08-17 17_11_21-ServiceNow Service Automation - Opera.png

The problem that I am now facing is that when the catalog item is submitted, all of the data in the HTML variable is cleared out! Even if I set it to readonly after being submitted, the data is still gone. This is definitely a showstopper as the people looking at the RITM won't have a clue what to do with it. Any suggestions on the cause here??? Or even a better way to go about capturing large amounts of data like this?

4 REPLIES 4

mamann
Mega Guru

My colleague wrote something along the lines of what you're looking for. You can find it on share @ ServiceNow Share


inderpal
Kilo Expert

Hi Kenneth


One work around is to copy the content of your HTML macro to a hidden Multiline Text Variable (on submit). On RITM, show this variable.


If you want to work with this macro only, then try to understand functionality of Watch List macro. Though that would be difficult but you can make it work according to you by modifying it. It would be bit difficult


That suggestion is one that I've actually already put to the test and while it does suffice as a workaround to what should be solid functionality OOB, I'm currently more interested in why my current method does not work. I've tested it in Fuji and it works just fine.


Hii Inderpal,



We are also facing the same issue. Could you please elaborate on below.



"One work around is to copy the content of your HTML macro to a hidden Multiline Text Variable (on submit). On RITM, show this variable."