#lists 56 articles
"Invalid text value" (HTTP 500) means a Text column hit its 255-character limit gotchas / rest-api Generic 500 naming no field; a Text column capped at 255 AddValidateUpdateItemUsingPath answers 200 when it creates nothing — while a write to a missing column is a loud 400 gotchas / rest-api Field errors sit inside a 200 and no item is created; a write to a missing column is a 400 on every path, never a silent drop CreateCopyJobs with MoveButKeepSource keeps version history, timestamps and authorship — and how to actually prove it gotchas / rest-api The server-side Copy and Move job preserves all versions, Created/Modified and Created By/Modified By, leaves the source in place, and is callable from the browser under delegated auth; omitting AllowSchemaMismatch is… Get-PnPList -Identity rejects server-relative URLs gotchas / powershell Title/GUID/web-relative only; /sites/team/shared fails as "List does not exist" MajorVersionLimit: 0 means unlimited, not none gotchas / lists One integer covering "no limit", "keep n" and "versioning is off"; the library your report calls tidiest is the one eating the quota POST /views takes an SP.View body — ViewTypeKind fails, and @odata.type passes only under OData v4 gotchas / rest-api ViewTypeKind from the creation-information docs 400s, and an @odata.type annotation passes only with OData-Version: 4.0; measured recipe for view + scope + column order stopPropagation in onClick does not stop the keyboard — a clickable row swallows Enter and Space of the buttons inside it gotchas / spfx A clickable row with onKeyDown also receives the Enter/Space of its inner buttons and checkboxes, so their action is cancelled (or runs twice) and the detail opens; react only when e.target === e.currentTarget A Choice value your field does not know is stored anyway — so a drifted vocabulary never announces itself gotchas / lists No 400, no error to swallow: a drifted vocabulary never shows at runtime; machine-check the type-to-schema contract A conditional spread hides a phantom column until SharePoint returns 400 gotchas / spfx ...(cond ? {…} : {}) bypasses the excess-property check, so a field the list doesn't have reaches the POST and 400s; two scripted sweeps find the rest A count over a ReadSecurity 2 list is only the reader's share — and the bit that says "sees everything" is Manage Lists alone gotchas / permissions Item-level read security filters rows silently, so a client-side count or ranking is the reader's own rows; show it only with ReadSecurity = 1 or Manage Lists in the reader's mask, and don't also demand Override List… A date in a group header is the reader's display string, not a date gotchas / lists @group.fieldData of a Date field is text in the reader's locale; reformat only when the shape matches A drop box for sensitive files — a document library can't do it, a list with ReadSecurity 2 and attachments can (measured, including the direct attachment URL) gotchas / permissions Giving someone write access to a protected library folder also lets them read every file in it; a list with ReadSecurity = 2, Contribute for the senders and Edit for the reviewers lets people send files they alone can… A folder created with folders/AddUsingPath in a generic list has no list item — breaking its permissions returns 404 gotchas / rest-api In a custom list (BaseTemplate 100) web/folders/AddUsingPath creates a 'naked' folder: ListItemAllFields is odata.null (@odata.null under SPFx's OData v4) and breakroleinheritance is 404. Create list folders with… A formatter renders empty in the tab you are iterating in — verify in a fresh tab gotchas / lists After many REST writes the working tab shows even valid formatters blank while a fresh tab renders them; one tab per version, a scratch view, and simple formatters on fragile lists A Hyperlink column takes an object, not a string gotchas / rest-api It reads back as { Description, Url } ([object Object], React #31) and a plain string fails the whole save with 400; one helper each way, 255-character address limit, scheme allowlist A list with WriteSecurity 4 ignores Contribute — only ManageLists gets through gotchas / permissions Only ManageLists (Design/Edit/Full Control) overrides the item-level write block, so "break inheritance + give the group Contribute" grants nothing; resolve the role by RoleTypeKind, not by its localised name A list's ETag tracks its schema, so ItemCount comes back stale via 304 gotchas / rest-api Adding items never moves the list entity's ETag, so revalidation answers 304 and the browser serves the body from when the list was empty; affects entity reads (GetList, lists(guid)), not collections or /items A missing attachment returns 400, not 404 – an "is it there?" check by status code reads "not there" as a failure gotchas / rest-api AttachmentFiles('name') on a missing attachment returns 400 ArgumentOutOfRangeException; check existence from the attachment list A non-web protocol in a formatter href silently drops the whole element gotchas / lists ms-word: in a formatter link removes the element with all children, per item, no error; open-in-app = openContextMenu A provisioned list with ReadSecurity=2 looks perfect to an admin and empty to everyone else gotchas / lists ReadSecurity=2 looks perfect to an admin and empty to everyone else; WriteSecurity=2 breaks collaborative edits only A REST write over 2 MB fails with "The request message is too big" gotchas / rest-api SharePoint Online rejects any REST request whose body exceeds 2,097,152 bytes (after JSON escaping, in UTF-8). A multi-line text field in a list holds far more than that – the cap is the request, not the field – so… A version is a full copy, not a delta — and a metadata-only edit costs one gotchas / lists The quota counts every version at full file size and a metadata-only edit costs one; measured on a live tenant, three column edits took a 1 MiB file to 4 MB Actions must go before the alias query string, not after the URL gotchas / rest-api Appending /breakroleinheritance(...) to a GetList(@u)?@u=... URL buries the action inside the parameter — splice it in before the ? Adding an attachment changes the item's ETag – the next MERGE with the old ETag fails with 412 gotchas / rest-api AttachmentFiles/add changes the item ETag; re-read before an IF-MATCH update An .html file in a document library cannot be iframed — SharePoint serves it as a download gotchas / lists SharePoint serves library HTML as an attachment, so the iframe loads empty; host it elsewhere and allow that host in HTML Field Security An empty Date field is not '' — blank dates render as overdue gotchas / lists Blank dates fall through to "overdue" and turn rows red; test .displayValue An evidence record whose "who" is written by the browser proves nothing — compare it with the server-stamped Author, and compare on the sign-in name too gotchas / lists Append-only lists let any contributor add a row with someone else's name in a text column; Author is stamped by SharePoint. Compare the two — but against Author/Name (the sign-in claim) as well, or every user whose… An unparseable JSON column is not an empty column — read-merge-write wipes the record gotchas / spfx catch → {} turns "could not read" into "is empty" and the next save writes the emptiness back over the record; keep three states, refuse the write before the first PATCH, lock the form visibly, and make recovery an… Breaking inheritance copies foreign Edit grants — and Edit defeats item-level security gotchas / security Another app's groups arrive with Edit, which carries ManageLists and bypasses item-level security; break without copying and prune the ACL — but only on a genuinely polluted scope, because copyRoleAssignments=false… Created/Modified on a document library won't stick — and the API says 200 while ignoring you gotchas / lists A plain MERGE reports 204 and SharePoint overwrites both with "now"; ValidateUpdateListItem + bNewDocumentUpdate is the only path that holds, it wants the web's locale format (the error message tells you which), reads… createfieldasxml ignores Name/StaticName — the internal name is derived from DisplayName gotchas / lists createfieldasxml on a list ignores Name/StaticName unless you pass Options: 8 (AddFieldInternalNameHint); otherwise the internal name is escaped from the label – create with ASCII and rename, or use the hint to keep a… FieldValuesAsText re-encodes underscores in JSON keys gotchas / rest-api A_x0020_B comes back as A_x005f_x0020_x005f_B; decode _x005f_ before matching Formatting length() is for arrays — on a string it wrecks the expression gotchas / lists String length via indexOf(str + '^', '^'), or the expression collapses to empty Gallery cards render from tileProps, not from formatter gotchas / lists The documented top-level formatter is ignored; the card lives in a nested, undocumented tileProps.formatter. Layout and card must go in two separate writes (PnP or REST/SPFx) Get lists by URL, not by title gotchas / rest-api getbytitle() breaks the moment someone renames a list; resolve by URL (bonus: GetList normalises folder paths to their list) List item IDs are never reused after a purge — but a recreated list starts at 1 again gotchas / lists Purging a list does not rewind its counter, so orphaned rows in a derived list are dead weight; a recreated list restarts at 1 and turns them into wrong-item attributions List item versions come back newest-first and include the current one – the opposite of file versions gotchas / rest-api items(id)/versions is DESCENDING and its first row is the current version (IsCurrentVersion: true) – the opposite of file /Versions; Created on a version is UTC WITHOUT the Z, so new Date() shifts it by the browser… Manage Lists lets you read other people's items on a WriteSecurity 2 list, but not edit them — that takes Override List Behaviors gotchas / permissions On a list with item-level write security, the Edit role (Manage Lists) still gets 403 when it updates an item someone else created; only a role with Override List Behaviors (CancelCheckout, Low 0x100) gets through, so… Migrating list items with original authors, dates — and their version history gotchas / lists Copy and Move does not do lists, but REST does the job item by item — AddValidateUpdateItemUsingPath takes Author, Editor, Created and Modified at creation (one call, one version), version history can be replayed with… Multi-line text in a document library stops at 255 characters gotchas / lists A REST MERGE stores 70k characters, but ValidateUpdateListItem rejects anything over 255 unless the column has UnlimitedLengthInDocumentLibrary – set it at creation or PATCH it later Per-user data vanishes for admin accounts: pageContext.user.email is empty and eq '' matches nothing gotchas / spfx Mailbox-less accounts get an empty pageContext.user.email; rows save under an empty key, SharePoint stores empty text as NULL, and $filter=Field eq '' never matches it again POST /fields rejects a subtype property like RichText unless the body names the subtype gotchas / rest-api { FieldTypeKind: 3, RichText: false } without @odata.type is read as SP.Field and fails with 400 – plain text columns in the same loop succeed, so the list ends up half-built; use CreateFieldAsXml or annotate the type Read all items from a large list — paging done right snippets / rest Any list past a few thousand items: $top caps at 5,000, $skip is ignored — follow odata.nextLink. Plus the error branch: break returns a partial list that looks complete REST DELETE on a list item is permanent — recycle() is the bin gotchas / rest-api The usual delete call skips BOTH recycle bins; /items(id)/recycle() is what a “restorable for 93 days” promise needs Retrying a write without the "new" columns on any 400 silently loses data — drop only the column the error names gotchas / rest-api When one new column is missing, a group-wide retry drops the ones that exist too; drop only the fields the error names as not existing, loop, and tell the user what was left out Seed idempotency must key on the item, not the collection gotchas / lists A per-SET presence check re-inserts the whole block; SharePoint cannot enforce a unique set + value pair, and two app starts at the same moment still race – after inserting, re-read and delete your own copies that are… SharePoint REST has no increment — a "+1" computed from the count you read at page load loses every vote cast in between gotchas / rest-api A MERGE writes a value, so count + 1 from what the page loaded, sent with IF-MATCH: *, overwrites every vote cast since that page load; count distinct AuthorIds of per-user rows, or read fresh and write with the item's… Telling a list's own columns from inherited ones — Hidden is not enough gotchas / rest-api Hidden is not enough; FromBaseType + CanBeDeleted are what separate the list's own columns The 5,000-item list view threshold — and why indexes must come early gotchas / lists It's scanned rows, not returned rows; index early, page always Title and Created are the fields you filter on — and the ones your provisioning code never indexes gotchas / lists Provisioning indexes only the columns it creates, so the most-filtered fields stay unindexed; past 5,000 items the read throttles and a swallowed error in a write path stops all writes silently Two MERGEs to the same list item at once: the second one fails with 409 Save Conflict even with IF-MATCH: * – and a fire-and-forget write just disappears gotchas / rest-api IF-MATCH: * only switches off the ETag check (412); SharePoint still refuses a second save of the same item while the first is in flight with 409 Save Conflict. Queue writes per item (list#id), retry 409 briefly, never… Version-gated provisioning silently drops the settings only an admin could write gotchas / lists A settings PATCH needs Manage Lists; the first member to open the app after an upgrade burns the one attempt and the version is stored anyway View counts and ratings written by readers cannot live in a list only editors may write gotchas / lists Views and ratings are written by the reader, so on a WriteSecurity: 4 content list every click is a swallowed 403 while the UI says thanks View formatting drops CSS gradients — use a solid background-color gotchas / lists background is not on the style allowlist and a gradient in background-image did not survive either; a white initial on a gradient avatar turns invisible, so use a solid background-color View formatting JSON can't contain < or & — XmlException on save gotchas / lists It's stored inside the view's schema XML; reverse the comparison and nest if() View formatting lands on the wrong view — and a missing column is not an empty string gotchas / lists Site Pages has no AllItems.aspx and the default view may be grouped; a column missing from the view is undefined, so the empty-check guard never hides it