Skip to main content
deleted 182 characters in body
Source Link

Need help with lookupsurl and rollup image fields in sitepages using SPFX with REST

I'm new to SPFX and still trying to find my way around. At At the moment I'm struggling to access lookupparticular fields from site pages using REST, currently not using PNP or other libraries, trying to stay vanilla for simplicity. I can manage CRUD for most fields in the pages library, but I'm not finding a way to access lookup field values. I realize this is a n00b request, but any help would be apppreciated.

The current requirement is to create a simple web part that will go onto the intranet landing page. It takes a single page URL as a property, validate that the URL uses a specific custom content type, and then display the article date, content type, comments, rollup image and a 'Read more' button linking to the page from the url property.

My current approach is roughly:

  export interface ISPList { 
        ContentType: any; 
        Id: string; 
        Url: any; 
        PublishingRollupImage: any; 
    }

and

 private _getListData(): Promise<ISPLists> { 

  return this.context.spHttpClient.get(this.context.pageContext.web.absoluteUrl + `/_api/web/lists/GetByTitle('Pages')/ItemsItems`, SPHttpClient.configurations.v1).then((response: SPHttpClientResponse) => {  
        debugger; 
        return response.json(); 
      }); 
  }

This works for the most part, but doesn't include values for the content Type, rollup image or url to the page represented by a given listitem. Suggestions Suggestions on accessing the fields mentioned, please?

Need help with lookups in SPFX with REST

I'm new to SPFX and still trying to find my way around. At the moment I'm struggling to access lookup fields from site pages using REST, currently not using PNP or other libraries, trying to stay vanilla for simplicity. I can manage CRUD for most fields in the pages library, but I'm not finding a way to access lookup field values. I realize this is a n00b request, but any help would be apppreciated.

The current requirement is to create a simple web part that will go onto the intranet landing page. It takes a single page URL as a property, validate that the URL uses a specific custom content type, and then display the article date, content type, comments, rollup image and a 'Read more' button linking to the page from the url property.

My current approach is roughly:

  export interface ISPList { 
        ContentType: any; 
        Id: string; 
        Url: any; 
        PublishingRollupImage: any; 
    }

and

 private _getListData(): Promise<ISPLists> {

return this.context.spHttpClient.get(this.context.pageContext.web.absoluteUrl + /_api/web/lists/GetByTitle('Pages')/Items, SPHttpClient.configurations.v1).then((response: SPHttpClientResponse) => {
debugger; return response.json(); }); }

This works for the most part, but doesn't include values for the content Type, rollup image or url. Suggestions on accessing the fields mentioned, please?

Need help with url and rollup image fields in sitepages using SPFX with REST

I'm new to SPFX and still trying to find my way around. At the moment I'm struggling to access particular fields from site pages using REST. I realize this is a n00b request, but any help would be apppreciated.

The current requirement is to create a simple web part that will go onto the intranet landing page. It takes a single page URL as a property, validate that the URL uses a specific custom content type, and then display the article date, content type, comments, rollup image and a 'Read more' button linking to the page from the url property.

My current approach is roughly:

export interface ISPList { 
  Id: string;
  Url: any;
  PublishingRollupImage: any;
}

and

private _getListData(): Promise<ISPLists> { 

  return this.context.spHttpClient.get(this.context.pageContext.web.absoluteUrl + `/_api/web/lists/GetByTitle('Pages')/Items`, SPHttpClient.configurations.v1).then((response: SPHttpClientResponse) => {  
        debugger; 
        return response.json(); 
      }); 
  }

This works for the most part, but doesn't include values for the rollup image or url to the page represented by a given listitem. Suggestions on accessing the fields mentioned, please?

deleted 13 characters in body
Source Link

I'm new to SPFX and still trying to find my way around. At the moment I'm struggling to access lookup fields from site pages using REST, currently not using PNP or other libraries, trying to stay vanilla for simplicity. I can manage CRUD for most fields in the pages library, but I'm not finding a way to access lookup field values. I realize this is a n00b request, but any help would be apppreciated.

The current requirement is to create a simple web part that will go onto the intranet landing page. It takes a single page URL as a property, validate that the URL uses a specific custom content type, and then display the article date, content type, comments, rollup image and a 'Read more' button linking to the page from the url property.

My current approach is roughly:

  export interface ISPList { //...other 
 fields... contentType      ContentType: any; 
        Id: string; 
        Url: any; 
        PublishingRollupImage: any; 
    }

and

 private _getListData(): Promise<ISPLists> {

return this.context.spHttpClient.get(this.context.pageContext.web.absoluteUrl + /_api/web/lists/GetByTitle('Pages')/Items, SPHttpClient.configurations.v1).then((response: SPHttpClientResponse) => {
debugger; return response.json(); }); }

This works for the most part, but doesn't include values for the content Type, rollup image or url. Suggestions on accessing the fields mentioned, please?

I'm new to SPFX and still trying to find my way around. At the moment I'm struggling to access lookup fields from site pages using REST, currently not using PNP or other libraries, trying to stay vanilla for simplicity. I can manage CRUD for most fields in the pages library, but I'm not finding a way to access lookup field values. I realize this is a n00b request, but any help would be apppreciated.

The current requirement is to create a simple web part that will go onto the intranet landing page. It takes a single page URL as a property, validate that the URL uses a specific custom content type, and then display the article date, content type, comments, rollup image and a 'Read more' button linking to the page from the url property.

My current approach is roughly:

export interface ISPList { //...other fields... contentType: any; Id: string; Url: any; PublishingRollupImage: any; }

and

 private _getListData(): Promise<ISPLists> {

return this.context.spHttpClient.get(this.context.pageContext.web.absoluteUrl + /_api/web/lists/GetByTitle('Pages')/Items, SPHttpClient.configurations.v1).then((response: SPHttpClientResponse) => {
debugger; return response.json(); }); }

This works for the most part, but doesn't include values for the content Type, rollup image or url. Suggestions on accessing the fields mentioned, please?

I'm new to SPFX and still trying to find my way around. At the moment I'm struggling to access lookup fields from site pages using REST, currently not using PNP or other libraries, trying to stay vanilla for simplicity. I can manage CRUD for most fields in the pages library, but I'm not finding a way to access lookup field values. I realize this is a n00b request, but any help would be apppreciated.

The current requirement is to create a simple web part that will go onto the intranet landing page. It takes a single page URL as a property, validate that the URL uses a specific custom content type, and then display the article date, content type, comments, rollup image and a 'Read more' button linking to the page from the url property.

My current approach is roughly:

  export interface ISPList {  
        ContentType: any; 
        Id: string; 
        Url: any; 
        PublishingRollupImage: any; 
    }

and

 private _getListData(): Promise<ISPLists> {

return this.context.spHttpClient.get(this.context.pageContext.web.absoluteUrl + /_api/web/lists/GetByTitle('Pages')/Items, SPHttpClient.configurations.v1).then((response: SPHttpClientResponse) => {
debugger; return response.json(); }); }

This works for the most part, but doesn't include values for the content Type, rollup image or url. Suggestions on accessing the fields mentioned, please?

Source Link

Need help with lookups in SPFX with REST

I'm new to SPFX and still trying to find my way around. At the moment I'm struggling to access lookup fields from site pages using REST, currently not using PNP or other libraries, trying to stay vanilla for simplicity. I can manage CRUD for most fields in the pages library, but I'm not finding a way to access lookup field values. I realize this is a n00b request, but any help would be apppreciated.

The current requirement is to create a simple web part that will go onto the intranet landing page. It takes a single page URL as a property, validate that the URL uses a specific custom content type, and then display the article date, content type, comments, rollup image and a 'Read more' button linking to the page from the url property.

My current approach is roughly:

export interface ISPList { //...other fields... contentType: any; Id: string; Url: any; PublishingRollupImage: any; }

and

 private _getListData(): Promise<ISPLists> {

return this.context.spHttpClient.get(this.context.pageContext.web.absoluteUrl + /_api/web/lists/GetByTitle('Pages')/Items, SPHttpClient.configurations.v1).then((response: SPHttpClientResponse) => {
debugger; return response.json(); }); }

This works for the most part, but doesn't include values for the content Type, rollup image or url. Suggestions on accessing the fields mentioned, please?