SpRestLib icon indicating copy to clipboard operation
SpRestLib copied to clipboard

$expand available?

Open flowerbot opened this issue 4 years ago • 2 comments

I like this library a lot, but am I able to use $expand? I have a column which is a lookup to another list - it would be great if I could use this library to expand the results - I can get $expand to work in a normal rest url but it doesn't look like $expand is a parameter option in sprLib? If it is, can you please point me to the demo page which shows how? thanks

flowerbot avatar Sep 04 '19 02:09 flowerbot

Im Using this library already for a long time and there is no option to use $expand in another way than with the complete rest call. At least i dont know any option on how to use it. Im always get Lookup Columns like this:

          items: any[] = await sprLib.rest({
            url: `https://sharepoint.example.com/_api/web/lists/getbytitle('list')/items?$select=lookup/Title&$expand=lookup`,
            type: 'GET',
          });

I dont see another way of using $expand with SpRestLib.

Oleskoo avatar Aug 07 '20 12:08 Oleskoo

$expand works fine with the List API:

I have a lookup column that references another list in "My List". I use this API call to get all of the details I need. I even filter by the data in the lookup column.

sprLib.list("My List").items({queryFilter:"OrgRepresenting/votingYN eq 'Yes'&$select=*,OrgRepresenting/Order0,OrgRepresenting/OrgShortTitle,OrgRepresenting/Title,OrgRepresenting/votingYN&$expand=OrgRepresenting/ID"})

cotaroba avatar Nov 23 '20 00:11 cotaroba