How to find all selectable properties of a list item
-
19-02-2021 - |
题
If I run the query ..._api/web/lists/GetByTitle('Site Pages')/items
, I get a list of properties, but it is not comprehensive. For example, FileRef is not visible in the resulting JSON, but can be selected explicitly.
Can I expose these hidden properties via a query, or is there somewhere I can find proper docs?
I thought SPBuiltInFieldId.FileRef Field would be handy as it lists some options that are selectable, but it also lists options that are not selectable, which is not great to work with.
I'm getting quite sick of a trial and error/trying my luck on google approach, so advice will be much appreciated!
解决方案
You can get all the list/library fields (hidden/read-only/required/optional) using below endpoint:
<siteUrl>/_api/web/lists/GetByTitle('Site Pages')/fields
Microsoft documentation: Working with lists and list items with REST