- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2023 08:18 AM - edited 10-09-2023 08:20 AM
Hi,
I am updating the Service Catalog TASKS from Excel 2019 (64 bit) using REST API. I am able to do updates. But I am facing some difficulties in updating "State" field. I like to know how to supply the values to the "State" field. Should we send as Integer format or as string format?
0 - Pending
1 - Open
2 - Work In Progress
3 - Closed Complete
4 - Closed InComplete
5 - Closed Skipped
I see the list values in the combo box of State field as above (only strings not numbers). Should I sent as Numbers as 0, 1, 2, etc or should I send as String like "Open", Work In Progress", etc. Is String a case sensitive?
Where to find the "State" Values?
Kindly help me to resolve this issue.
Thank you all.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2023 08:34 AM
You need to send the integer values, for checking the backend values of state just right click on state field on the form and click on "show choice lists"
Note: Please check the state values at your instance, might be someone has updated it
If my answer solved your issue, please mark my answer as ✅ Correct & 👍Helpful based on the Impact.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2023 08:43 AM
@SN_2023 Here are the values for the state field.
Also, you can find the state values using the following steps.
1. Right click on the state field and choose config dictionary.
On the list, apply the filter Element is state and table is task (SC task inherits from task table)
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2023 10:39 AM
Thank you. Issue resolved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2023 08:51 AM - edited 10-09-2023 08:52 AM
Hi @SN_2023 ,
When updating the "State" field of Service Catalog tasks using the REST API, you should send the values as strings, not integers. The strings should match the display values in the combo box exactly. String comparisons are generally case-sensitive in most programming contexts, so you need to send the correct string values with the appropriate casing.
In your case, you should send the following string values for the "State" field:
- "Pending"
- "Open"
- "Work In Progress"
- "Closed Complete"
- "Closed InComplete"
- "Closed Skipped"
Ensure that you send these values as strings in the REST API request payload. For example, if you are sending a JSON payload, it might look like this:
{
"State": "Open",
// other fields and their values
}
To find the valid values for the "State" field, you can check the Service Catalog task table in ServiceNow. Follow these steps:
1. **Log in to your ServiceNow instance.**
2. **Navigate to the Service Catalog Task Table:**
- For classic UI, go to "Service Catalog" > "Catalog Tasks".
- For the new UI, go to "Service Catalog" > "Catalog Tasks".
3. **Click on the "State" field in a task record to view the available options.**
- Here, you'll see the exact strings that should be used when updating the "State" field through the REST API.
Always refer to the actual values available in your specific ServiceNow instance, as they can be customized. Sending the values as strings matching the display values ensures accurate updates to the "State" field in Service Catalog tasks.
Mark my answer helpful & accepted if it helps you resolve your issue
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2023 10:43 AM
Hi danish,
I am able to supply the values for "State" field only in Number format. If I send the value as String, the TASK becomes "Closed Complete" automatically irrespective of any given value.
I saw the "State" value type. It says as "Integer" Type.
Thank you for your response.