Edit a List Item
Use the WebEOCListItem EditListItem call to edit the name or color of a list item in WebEOC Nexus.
| Description | Revises a list item in WebEOC Nexus |
|---|---|
| URL | /lists/[listname]/[listItem] |
| Method | POST |
| Parameters |
listName or listItem |
| Return Type | WebEOCListItem |
| Sample JSON Response |
Copy Code
|
Review the parameter definitions and examples of how to edit the name or color in JavaScript and C# calls.
Parameters
| Variable Name | Type | Description | Required |
|---|---|---|---|
| listName | String | Name of the list in WebEOC Nexus. | True (URL) |
| listItem | WebEOCListItem | List item to be edited. See Custom Objects. | False |
If you do not select or specify a color attribute, a color is not associated with the list item; any existing values in WebEOC Nexus are not affected.
To delete sub-lists for a list item, submit in an empty sub items array.
WebEOCListItem: Custom Objects
The WebEOCListItem, returned when using the EditListItem endpoint, contains several unique, custom objects.
| Member Name | Type | Description |
|---|---|---|
| name | String | Name of the list item |
| subitems | List of WebEOCListITems | Recursive list of itself |
| color | Hex color code string | Color associated with the list item |
Examples
JavaScript Call
var list = {
name: "List01_Updated"
};
await fetch(`${baseUrl}/lists/List01/ListItem01`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(list)
})
C# Call
public async Task<WebEOCListItem> EditListItem()
{
using (var httpClient = new HttpClient(httpClientHandler))
{
var list = new
{
name = "ListItem01_Updated"
};
var serializedInformation = JsonConvert.SerializeObject(list);
var response = await httpClient.PostAsync($"{baseUrl}/lists/list01/listitem01",
new StringContent(serializedInformation, Encoding.UTF8,
"application/json"));
var data = await response.Content.ReadAsStringAsync();
return JsonConvert.DeserializeObject<WebEOCListItem>(data);
}
}
Related Concepts
Related Tasks