Advanced add/update
Advanced creating and updating items
In addition to standard OData add and update items operations REST provides such useful methods as AddValidateUsingPath
and ValidateUpdateListItem
. The first is only presented in modern SharePoint, it not only allows adding items right in a sub folder but also operate with form data payloads and control check in process. ValidateUpdateListItem
is handy for operations requiring system-like-update logic via pure REST.
In Gosip, AddValidateUsingPath
and ValidateUpdateListItem
are represented with Items().AddValidate()
and Item.UpdateValidate()
methods correspondingly:
Add validate
As DecodedPath
option the relative path to folder can be provided. It's optional. The path should be relative to a web without trailing slash in the beginning. Gosip adds web relative URL automatically.
ValidateAddOptions
are also optional, when no new document update or check-in comment or folder path are ever required, a nil
value should be passed.
Update validate
Using update validate is almost the same:
Form values fingerprints
Form values passed to the methods should stand for an array of { FieldName: "", FieldValue: "" }
objects where field value is a string of specific format depending on field's data type.
Gosip simplifies this payload operating with map of strings. In payload, map key should stand for a valid FieldName
, a value, obviously, is the one mapped to FieldValue
.
The fingerprints for the data types are following:
Last updated