SPFX Getting "undefined" when asking for author name.

%3CLINGO-SUB%20id%3D%22lingo-sub-186119%22%20slang%3D%22en-US%22%3ESPFX%20Getting%20%22undefined%22%20when%20asking%20for%20author%20name.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-186119%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EI%20am%20testing%20sp-pnp-js%20and%20for%20that%20I%20choose%20get%20information%20from%20the%20Site%20Pages%20library.%26nbsp%3B%3C%2FP%3E%3CP%3EMore%20specific%20I%20am%20trying%20to%20get%20the%20%22Description%22%2C%20%22Title%22%20and%20%22Author%22%20properties%20of%20the%20items%20in%20the%20Site%20Pages%20library.%3C%2FP%3E%3CP%3EI%20am%20getting%20the%20Title%20and%20Description%20but%20the%20Author%20is%20undefined%20and%20I%20don't%20know%20why.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20using%20this%20basic%20code%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%3E%3CPRE%3E%3CSPAN%3Eexport%3C%2FSPAN%3E%20%3CSPAN%3Einterface%3C%2FSPAN%3E%3CSPAN%3E%20IPnpWebPartProps%20%7B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20description%3C%2FSPAN%3E%3CSPAN%3E%3A%3C%2FSPAN%3E%3CSPAN%3E%20string%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3Eexport%3C%2FSPAN%3E%20%3CSPAN%3Einterface%3C%2FSPAN%3E%3CSPAN%3E%20ISPList%20%7B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20Title%3C%2FSPAN%3E%3CSPAN%3E%3A%3C%2FSPAN%3E%3CSPAN%3E%20string%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20Author%3C%2FSPAN%3E%3CSPAN%3E%3A%3C%2FSPAN%3E%3CSPAN%3E%20string%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20Description%3C%2FSPAN%3E%3CSPAN%3E%3A%3C%2FSPAN%3E%3CSPAN%3E%20string%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3Eexport%3C%2FSPAN%3E%20%3CSPAN%3Edefault%3C%2FSPAN%3E%20%3CSPAN%3Eclass%3C%2FSPAN%3E%3CSPAN%3E%20PnpWebPart%20%3C%2FSPAN%3E%3CSPAN%3Eextends%3C%2FSPAN%3E%3CSPAN%3E%20BaseClientSideWebPart%3CIPNPWEBPARTPROPS%3E%20%7B%3C%2FIPNPWEBPARTPROPS%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3Eprivate%3C%2FSPAN%3E%3CSPAN%3E%20_getListData()%3C%2FSPAN%3E%3CSPAN%3E%3A%3C%2FSPAN%3E%3CSPAN%3E%20Promise%3CISPLIST%3E%20%7B%3C%2FISPLIST%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3Ereturn%3C%2FSPAN%3E%3CSPAN%3E%20pnp.sp.web.lists.getByTitle(%3C%2FSPAN%3E%3CSPAN%3E%22Site%20Pages%22%3C%2FSPAN%3E%3CSPAN%3E).items.get().then((response)%20%3C%2FSPAN%3E%3CSPAN%3E%3D%26gt%3B%3C%2FSPAN%3E%3CSPAN%3E%20%7B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3Ereturn%3C%2FSPAN%3E%3CSPAN%3E%20response%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%7D)%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%7D%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3Eprivate%3C%2FSPAN%3E%3CSPAN%3E%20getListData()%3C%2FSPAN%3E%3CSPAN%3E%3A%3C%2FSPAN%3E%3CSPAN%3E%20void%20%7B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3Ethis%3C%2FSPAN%3E%3CSPAN%3E._getListData()%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20.then((response)%20%3C%2FSPAN%3E%3CSPAN%3E%3D%26gt%3B%3C%2FSPAN%3E%3CSPAN%3E%20%7B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3Ethis%3C%2FSPAN%3E%3CSPAN%3E._renderList(response)%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%7D)%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%7D%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3Eprivate%3C%2FSPAN%3E%3CSPAN%3E%20_renderList(items%3C%2FSPAN%3E%3CSPAN%3E%3A%3C%2FSPAN%3E%3CSPAN%3E%20ISPList%5B%5D)%3C%2FSPAN%3E%3CSPAN%3E%3A%3C%2FSPAN%3E%3CSPAN%3E%20void%20%7B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3Elet%3C%2FSPAN%3E%3CSPAN%3E%20html%3C%2FSPAN%3E%3CSPAN%3E%3A%3C%2FSPAN%3E%3CSPAN%3E%20string%20%3C%2FSPAN%3E%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E'%3CTABLE%20class%3D%22TFtable%22%20border%3D%221%22%20width%3D%22100%25%22%20style%3D%22border-collapse%3A%20collapse%3B%22%3E'%3CSPAN%3E%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20html%20%3C%2FSPAN%3E%3CSPAN%3E%2B%3D%3C%2FSPAN%3E%20%3CSPAN%3E%60%3CTBODY%3E%3CTR%3E%3CTH%3ETitle%3C%2FTH%3E%3CTH%3EAuthor%3C%2FTH%3E%3CTH%3EContent%3C%2FTH%3E%60%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20items.forEach((item%3C%2FSPAN%3E%3CSPAN%3E%3A%3C%2FSPAN%3E%3CSPAN%3E%20ISPList)%20%3C%2FSPAN%3E%3CSPAN%3E%3D%26gt%3B%3C%2FSPAN%3E%3CSPAN%3E%20%7B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20html%20%3C%2FSPAN%3E%3CSPAN%3E%2B%3D%3C%2FSPAN%3E%20%3CSPAN%3E%60%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%3CTBODY%3E%3CTR%3E%20%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%3CTBODY%3E%3CTR%3E%3CTD%3E%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FSPAN%3E%3CSPAN%3E%24%7B%3C%2FSPAN%3E%3CSPAN%3Eitem.Title%3C%2FSPAN%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3CSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%3CTBODY%3E%3CTR%3E%3CTD%3E%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FSPAN%3E%3CSPAN%3E%24%7B%3C%2FSPAN%3E%3CSPAN%3Eitem.Author%3C%2FSPAN%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3CSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%3CTBODY%3E%3CTR%3E%3CTD%3E%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FSPAN%3E%3CSPAN%3E%24%7B%3C%2FSPAN%3E%3CSPAN%3Eitem.Description%3C%2FSPAN%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3CSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%60%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%7D)%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20html%20%3C%2FSPAN%3E%3CSPAN%3E%2B%3D%3C%2FSPAN%3E%20%3CSPAN%3E%60%3C%2FSPAN%3E%3C%2FTABLE%3E%60%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3Econst%3C%2FSPAN%3E%3CSPAN%3E%20listContainer%3C%2FSPAN%3E%3CSPAN%3E%3A%3C%2FSPAN%3E%3CSPAN%3E%20Element%20%3C%2FSPAN%3E%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3Ethis%3C%2FSPAN%3E%3CSPAN%3E.domElement.querySelector(%3C%2FSPAN%3E%3CSPAN%3E'%23spGetListItems'%3C%2FSPAN%3E%3CSPAN%3E)%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20listContainer.innerHTML%20%3C%2FSPAN%3E%3CSPAN%3E%3D%3C%2FSPAN%3E%3CSPAN%3E%20html%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%7D%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3Epublic%3C%2FSPAN%3E%3CSPAN%3E%20render()%3C%2FSPAN%3E%3CSPAN%3E%3A%3C%2FSPAN%3E%3CSPAN%3E%20void%20%7B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3Ethis%3C%2FSPAN%3E%3CSPAN%3E.domElement.innerHTML%20%3C%2FSPAN%3E%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E%60%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%3CDIV%20class%3D%22parentContainer%22%20style%3D%22background-color%3A%20lightgrey%22%3E%3C%2FDIV%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%3CDIV%20style%3D%22background-color%3A%20lightgrey%22%20id%3D%22spGetListItems%22%3E%3C%2FDIV%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%3C%2FSPAN%3E%3C%2FPRE%3E%3C%2FDIV%3E%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%60%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3Ethis%3C%2FSPAN%3E%3CSPAN%3E.getListData()%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%7D%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3Eprotected%3C%2FSPAN%3E%20%3CSPAN%3Eget%3C%2FSPAN%3E%3CSPAN%3E%20dataVersion()%3C%2FSPAN%3E%3CSPAN%3E%3A%3C%2FSPAN%3E%3CSPAN%3E%20Version%20%7B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3Ereturn%3C%2FSPAN%3E%3CSPAN%3E%20Version.parse(%3C%2FSPAN%3E%3CSPAN%3E'1.0'%3C%2FSPAN%3E%3CSPAN%3E)%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%7D%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3Eprotected%3C%2FSPAN%3E%3CSPAN%3E%20getPropertyPaneConfiguration()%3C%2FSPAN%3E%3CSPAN%3E%3A%3C%2FSPAN%3E%3CSPAN%3E%20IPropertyPaneConfiguration%20%7B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3Ereturn%3C%2FSPAN%3E%3CSPAN%3E%20%7B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20pages%3A%20%5B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%7B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20header%3A%20%7B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20description%3A%20strings.PropertyPaneDescription%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%7D%2C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20groups%3A%20%5B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%7B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20groupName%3A%20strings.BasicGroupName%2C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20groupFields%3A%20%5B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20PropertyPaneTextField(%3C%2FSPAN%3E%3CSPAN%3E'description'%3C%2FSPAN%3E%3CSPAN%3E%2C%20%7B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20label%3A%20strings.DescriptionFieldLabel%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%7D)%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%5D%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%7D%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%5D%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%7D%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%5D%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%7D%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%20%7D%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3CP%3EBut%20the%20author%20is%20always%20undefined.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20it%20possible%20to%20get%20the%20Author%20name%3F%3C%2FP%3E%3CP%3EBest%20regards%3C%2FP%3E%3CP%3EAmerico%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-186119%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPnP%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-187479%22%20slang%3D%22en-US%22%3ERe%3A%20SPFX%20Getting%20%22undefined%22%20when%20asking%20for%20author%20name.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-187479%22%20slang%3D%22en-US%22%3EThanks!%20I%20will%20test%20it%20in%20the%20weekend%20%3Athumbs_up%3A%3C%2Fimg%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-186700%22%20slang%3D%22en-US%22%3ERe%3A%20SPFX%20Getting%20%22undefined%22%20when%20asking%20for%20author%20name.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-186700%22%20slang%3D%22en-US%22%3E%3CP%3EAuthor%20is%20a%20field%20of%20type%20people%20or%20group.%20It%20is%20actually%20a%20kind%20of%20lookup%20column.%20So%2C%20to%20retrieve%20the%20value%2C%20you%20need%20%22expand%22%20it.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EModify%20your%20REST%20endpoint%20as%20%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3Epnp.sp.web.lists.getByTitle(%22Site%20Pages%22).items.select(%22Title%22%2C%20%22Description%22%2C%20%22Author%2FTitle%22%2C%22Author%2FName%22).expand(%22Author%22).get().then((response)%20%3D%26gt%3B%20%7B%3C%2FP%3E%3CP%3Econsole.log(response)%3B%3C%2FP%3E%3CP%3E%7D)%3B%3CBR%20%2F%3E%3CBR%20%2F%3EThis%20will%20get%20the%20response%20as%20in%20the%20below%20screenshot%2C%20you%20need%20to%20make%20necessary%20change%20in%20your%20code%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20756px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F32905i7418482401CD8A38%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Capture.PNG%22%20title%3D%22Capture.PNG%22%20%2F%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Regular Contributor

Hi,

I am testing sp-pnp-js and for that I choose get information from the Site Pages library. 

More specific I am trying to get the "Description", "Title" and "Author" properties of the items in the Site Pages library.

I am getting the Title and Description but the Author is undefined and I don't know why.

 

I am using this basic code: 

 

export interface IPnpWebPartProps {

description: string;

}

export interface ISPList {

Title: string;

Author: string;

Description: string;

}

export default class PnpWebPart extends BaseClientSideWebPart<IPnpWebPartProps> {

private _getListData(): Promise<ISPList[]> {

return pnp.sp.web.lists.getByTitle("Site Pages").items.get().then((response) => {

return response;

});

}

private getListData(): void {

this._getListData()

.then((response) => {

this._renderList(response);

});

}

private _renderList(items: ISPList[]): void {

let html: string = '<table class="TFtable" border=1 width=100% style="border-collapse: collapse;">';

html += `<th>Title</th><th>Author</th><th>Content</th>`;

items.forEach((item: ISPList) => {

html += `

<tr>

<td>${item.Title}</td>

<td>${item.Author}</td>

<td>${item.Description}</td>

</tr>

`;

});

html += `</table>`;

const listContainer: Element = this.domElement.querySelector('#spGetListItems');

listContainer.innerHTML = html;

}

public render(): void {

this.domElement.innerHTML = `

<div class="parentContainer" style="background-color: lightgrey">

<div style="background-color: lightgrey" id="spGetListItems" />

</div>

`;

this.getListData();

}

protected get dataVersion(): Version {

return Version.parse('1.0');

}

protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration {

return {

pages: [

{

header: {

description: strings.PropertyPaneDescription

},

groups: [

{

groupName: strings.BasicGroupName,

groupFields: [

PropertyPaneTextField('description', {

label: strings.DescriptionFieldLabel

})

]

}

]

}

]

};

}

}

But the author is always undefined.

 

Is it possible to get the Author name?

Best regards

Americo

2 Replies
Highlighted

Author is a field of type people or group. It is actually a kind of lookup column. So, to retrieve the value, you need "expand" it. 

Modify your REST endpoint as :

pnp.sp.web.lists.getByTitle("Site Pages").items.select("Title", "Description", "Author/Title","Author/Name").expand("Author").get().then((response) => {

console.log(response);

});

This will get the response as in the below screenshot, you need to make necessary change in your code:

Capture.PNG

Highlighted
Thanks! I will test it in the weekend :thumbs_up: