- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2022 03:27 AM
Hi All,
I am trying to read the variable values from a requested item using REST API. I queried the table "sc_item_option_mtom" with the below context.
sc_item_option_mtom.request_item=<<sys_Id of the corresponding RITM>>
The output response from postman looked something like below:
{
"result": [
{},
{},
{},
{},
{}
]
}
What does this response mean? What is the mistake that am making here? I would like to capture the values of the custom variables in a request item.
Thank you!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 12:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 03:46 AM
Please update "sysparm_display_value" to true in REST API Explorer.
Note: Table level API is ok if you are planning to use this API for only one catalog item with limited fields/variables to retreive.
If you configure a scripted rest API, you can leverage it for all request items which is a more stable and configurable solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2022 03:41 AM
I think you don't need to query sc_item_option_mtom table. You can directly use "variables.<variable name>" to get the value of RITM variables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2022 03:49 AM
Hi Swapna,
Just tried the way you suggested as below. "Department" is one of the variables of the RITM and sys_id corresponds to the RITM.
The response was still empty.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2022 04:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2022 06:27 AM
The API looks fine. Is Department variable present on the Requested Item in variables section? Please share the screenshot of the variable.