Variable Editor fields Query

tejumes
Kilo Guru

I have set Variable Editor into the sc_request table with the use of below Formatter

find_real_file.png

Now My request page looks like below.

find_real_file.png

Now for reporting purpose i want to see the all the fields from the variable editor as shown above in readonly.

I can bring all the values and questions into description field as said in SNGuru BUT i need each and every field separetly in any tables or views so that the user can access these fields to generate a report.

Any help on this?

I tried as said in this Reporting on Service Catalog Variables - ServiceNow Wiki   BUT I'm nt sure how to set up the where clause since we are using this variable editor in sc_request table.

I tried this

find_real_file.png

But couldn't get any record when i click on "try it" it shows blank

Please help!!

7 REPLIES 7

OK, here are some ideas...



See the wiki for better info...


http://wiki.servicenow.com/index.php?title=Using_Service_Catalog_Variables#gsc.tab=0


Scriptable Service Catalog Variables - ServiceNow Wiki



When you fill out a request form, the variables are going into the request item, not the request, so to get to variables, you need to start from the item.   The request record could be associated with a number of items, so the variables don't stack up there.



When you created your form in the maintain items interface, you need to make sure you define names for the variables AND make sure they are unique.   I usually use an item\name type scheme (ie. item_variablename).   This makes them easier to reference.



if you wanted to drop your variables into a table for reporting (ie. u_my_test_reporting_table), you would set up the table and the fields in it.



Then you could use a script or workflow script on the sc_req_item table to drop values into the table fields.



var tt = new GlideRecord('u_reporting_table_my_test);


tt.from_item = current.number;


tt.short_description = current.short_description;


tt.fielda = current.variables.item_fielda;


tt.fieldb = current.variables.item_fieldb;


etc...


tt.insert();



I'm sure someone else will have a better answer but this could allow you to whip up a special use case reporting table without too much hassle.   You could then create reports against the u_reporting_table_my_test table.


Karsten,



Your explanation is exactly how we worked around this issue, too.   Anything you want to report on has to be in a field, unless you go the database view route, which sometimes is not very helpful.



Thanks,



Laurie


ersureshbe
Giga Sage
Giga Sage

Hi,

 

I want to show the variables into REQ form. What are the steps i need to follow to shoe the variables in sc_request form?

 

Please advise.

 

Regards,

Suresh L

Regards,
Suresh.