Export variables from a request item with export definitions

KB15
Giga Guru

I'm currently looking for a solution that would allow for exporting of variables from a request item. We're currently on Helsinki and I saw that there's a relatively new feature called Export sets. I've tried to create an export definition from the requested item table however the ability to export variables isn't functioning. I can select variables but it doesn't give me the option to select the columns I need as you would in a standard report. Selecting just the variables option (if it appears) disappears after saving it or previewing it.

I'm looking at this solution because the data has to go to an FTP site, unless there's a way to do it from a scheduled report.

1 ACCEPTED SOLUTION

KB15
Giga Guru

I've contacted ServiceNow about this and the export set only supports the export of whole tables and not its relationships to others. Variables are not included in this export method either unlike a standard report.



So, would it make sense to export the contents of a request item into a separate table and then export that via export set? If it is, would the action of copying the data to the new table require scripting or is there something simpler that could accomplish this?



The goal here is to export the variables selected by a user and have that data sent to an external FTP site to be processed. Ultimately updated data would be fed back into SN via scheduled import to process a service catalog item's workflow automatically.



(Update: The approach taken is to create another table when you can dump all the results out of what you're trying to capture and have that exported out using export sets.)


View solution in original post

11 REPLIES 11

Hi Iyes,

Thanks for sharing this.
I tried to follow the same steps, but Fields are not getting exported.

I always see just 5 fields in the exported data, no matter how many Fields I add in the Selected Grid.

5 Fields I receive : 

{
"request_item.cat_item": "87c068cfdb975c9cb9186033ca9619ba",
"sc_item_option.value": "55c9c9fddb6ae70cb4a873e78c9619dd",
"request_item": "d4eae56cdb7314d856c40d0af49619e2",
"sc_item_option": "54eae56cdb7314d856c40d0af49619e0",
"sc_item_option.item_option_new": "00cde3e74f9ee600d2d797411310c74b",
"request_item.state": "1",
"__status": "success"
}

Hi Iyes,

Thanks for sharing the info related to many to many table: "variable ownership sc_item_option_mtom" table.

In my case I am able to export the variables supplied by user (like multi-line text and select-box), 
But I am not able to export the data from "Variable Set" and "reference variables".
When I try to export only sysid is exported, not the the "Display Value".

Sample output :

Reference data variable (Group name) comes from custom table: 

{
"request_item.cat_item": "87c068cfdb975c9cb9186033ca9619ba",
"sc_item_option.value": "987a2c02db17109cb9186033ca9619d4",
"dv_sc_item_option": "58eae56cdb7314d856c40d0af49619e0",
"dv_request_item.cat_item": "Secure (PCI) AD User Modify Group Membership",
"dv_request_item": "RITM6608623",
"request_item": "d4eae56cdb7314d856c40d0af49619e2",
"sc_item_option": "58eae56cdb7314d856c40d0af49619e0",
"dv_sc_item_option.item_option_new": "Group Name",
"sc_item_option.item_option_new": "d8f32917db13d0dcb9186033ca96192c",
"dv_sc_item_option.value": "987a2c02db17109cb9186033ca9619d4",
"__status": "success"
}

Variable Set data variable (Approving Manager) :

{
"request_item.cat_item": "87c068cfdb975c9cb9186033ca9619ba",
"sc_item_option.value": "55c9c9fddb6ae70cb4a873e78c9619dd",
"dv_sc_item_option": "54eae56cdb7314d856c40d0af49619e0",
"dv_request_item.cat_item": "Secure (PCI) AD User Modify Group Membership",
"dv_request_item": "RITM6608623",
"request_item": "d4eae56cdb7314d856c40d0af49619e2",
"sc_item_option": "54eae56cdb7314d856c40d0af49619e0",
"dv_sc_item_option.item_option_new": "Approving Manager",
"sc_item_option.item_option_new": "00cde3e74f9ee600d2d797411310c74b",
"dv_sc_item_option.value": "55c9c9fddb6ae70cb4a873e78c9619dd",
"__status": "success"
}

 

Can you please suggest if it is even possible to export "Variable Set" and "reference variables" data using Export definition?

Thanks in advance for your help.