문제

I would like to do an orderby on an expanded field when querying a SharePoint list.

so for example: $select=File/Name&$expand=File&$orderby=File/Name

However, including the orderby on the expanded property causes an error. I can successfully order by fields on the main level, just not at the expanded level.

Any ideas?

Thanks in advance, Jake.

올바른 솔루션이 없습니다

다른 팁

Jake,

I haven't been able to order by an expanded field (yet), but if you're trying to sort by file name, you can use the following REST ODATA query:

/_api/lists/getbytitle('documents')/items/?$select=FileLeafRef&$orderby=FileLeafRef%20asc

FileLeafRef is a top-level field containing the file name.

Which I found using:

/_api/lists/getbytitle('documents')/Fields

to get the list of fields available on the list.

I hope it helps?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top