Correct Checkbox Value from Variable Set Not Showing Up on RITM

jmiskey
Kilo Sage

We are experiencing some really odd behavior where the value of a checkbox (from a Variable Set) from a Catalog Item that is being filled out in the Service Portal is not being reflected properly on the RITM that is submitted, even though the underlying table show the correct value!  I think this is best explained with an example.

So, we have a checkbox that toggles between two different fields (they have the same label, but different names; class_id and class_id2).  If the checkbox is not selected, the class_id field is displayed and made mandatory (and this is a reference field).  If the checkbox is selected, the class_id2 field is displayed and made mandatory (and this is a free-from field).

So, I am checking the box and entering in a free-form value, like this:

find_real_file.png

After submitting it, if I go into ServiceNow, and look up the value of what was submitted in the "Options" table, it shows that the check box is selected:

find_real_file.png

Now, if I bring up the RITM for this submission, and look in the Variable section, it incorrectly shows the check box as being unchecked, and therefore shows class_id (the reference field), like this:

find_real_file.png

If I manually check the check box on this form, I see my correct value (the free-form field):

find_real_file.png

The question is, why is it not showing the correct value for the checkbox when I bring up the RITM?  Has anyone ever seen anything like this?

I do have a bunch of Catalog Client Scripts and Catalog UI Policies on the Variable Set being used that are supposed to be reflected back on the Requested Item, but the form shows properly when I submit it on the Service Portal, so I don't understand why it would look/behave any differently on the RITM.

Thanks

 

1 ACCEPTED SOLUTION

Allen Andreas
Administrator
Administrator

This sounds like you could have some sort of onLoad client script or something that is removing that check from the checkbox and perhaps setting it to false, which is turn causes the chain of events to occur like you've mentioned. This is even more so plausible given that as soon as you check the box, the manual text entry -- exactly what you submitted it as...appears...meaning data is being retained.

I'd recommend looking at possibly an onLoad or something causing this field to be cleared.

To further test this...you could just turn off all UI Policies or Client Script and just have all fields exposed, run a test and see if the box remains checked this time, if so...start to turn things back on and see where the issue is.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

6 REPLIES 6

Allen Andreas
Administrator
Administrator

This sounds like you could have some sort of onLoad client script or something that is removing that check from the checkbox and perhaps setting it to false, which is turn causes the chain of events to occur like you've mentioned. This is even more so plausible given that as soon as you check the box, the manual text entry -- exactly what you submitted it as...appears...meaning data is being retained.

I'd recommend looking at possibly an onLoad or something causing this field to be cleared.

To further test this...you could just turn off all UI Policies or Client Script and just have all fields exposed, run a test and see if the box remains checked this time, if so...start to turn things back on and see where the issue is.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

The more I look into it, the more I think you are probably correct.  I have already eliminated a lot of the Catalog UI Policies and Catalog Client Scripts, and it has made no difference.  The ones that I have left, none of them make any changes to the field's value or properties.

So, I should be looking for Client Scripts, specifically "OnLoad" ones on the Requested Item table, right?  Should I also be checking the parent table (Task)?  Or any other Business Rules or anything like that?  Is there anything specific to the Variables section of RITMs?

I am just trying to determine all the places I should look, other than OnLoad Client Scripts on the Requested Items table.

Thanks

It's pretty narrow scope where you need to check...if these are variables unique to a set catalog item...then you just need to look at UI policies and client script for this catalog item specifically.

Service Catalog > Maintain Items > Click record for cat item...check the UI policies and client scripts tab.

I would look for onLoad client scripts, but still check over others.

Like I mentioned above...I would just turn off all client scripts and ui policies for this cat item...submit a test run and see that the field still stays checked. This would eliminate any widespread panic that it's some system issue...ya know?

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Well, it is not quite that simple.  This is all part of one Variable Set that is in a Catalog Item.  The Catalog Item has 6 Variables Sets in it.  So, would I need to deactive the OnLoad Catalog Client Scripts in all 6 Variable Sets and the Catalog Item, to be sure?