Skip to main content

Sharepoint 2013 REST API limitations with site columns

Recently i attended an interview for one of the company, the interviewer asked me a question on rest api. How to get a publishing image field using rest api? I answered its the normal way how we get the other fields. But later i came to know that its the wrong answer. After some research on Google came to know that there some limitations to rest api in sharepoint 2013. Below is a list of columns available using Rest api.

ColumnSupportNotes
Hyperlink or PictureSupported
Single Line of TextSupported
Multiple lines of text :: PlaintextSupported
Multiple lines of text :: RichtextSupportedReturns unencoded XHTML
Multiple lines of text :: Enhanced RichtextSupportedReturns unencoded XHTML
ChoiceSupportedColumn is required in the $expand keyword
CounterSupported
IntegerSupported
NumberSupported
CurrencySupported
DateSupportedReturns an ISO 8601 date e.g. 2013-03-08T11:00:00
Yes/NoSupportedReturns true or false string literals
Person or GroupSupportedColumn is required in the $expand keyword, append “Id” to the column name to get the user id (UserInformationList) value inline with each entry
Person or Group (Multi)SupportedColumn is required in the $expand keyword
CalculatedSupported
ComputedSupported
Managed MetadataNot Supported
Managed Metadata (Multi)Not Supported
Publishing HTMLNot Supported
Publishing HyperlinkNot Supported
Publishing ImageNot Supported
Media FieldNot Supported
Summary LinksNot Supported
Publishing ImageNot Supported
LookupSupportedColumn is required in the $expand keyword, append “Id” to the column name to get the lookup column target id value inline with each entry
Lookup (Multi)SupportedColumn is required in the $expand keyword
As far as getting the publishing image field we need to make two requests. First get the item using the below query

Request1 url: http://wingtip.com/_api/web/lists/getbytitle('contacts')/items

In the second request we need to add fieldvalueashtml to url.

Request2 url: http://wingtip.com/_api/web/lists/getbytitle('contacts')/items(1)/fieldvalueashtml


Reference: http://stackoverflow.com/questions/25852997/retrieve-publishing-image-field-with-sharepoint-2013-rest-api-csom

http://www.ashokraja.me/post/Querying-and-exploring-REST-API-with-oData-in-SharePoint-2013-with-DataBase-net.aspx



Hope its helpful.


Comments

  1. Excellent beat ! I wish to apprentice at the same time as you amend your web site, how can i subscribe for a blog website? The account aided me a appropriate deal. I had been tiny bit familiar of this your broadcast provided vibrant clear concept

    ReplyDelete

Post a Comment

Popular posts from this blog

How to upgrade typescript version in a SPFX solution

Why do we need to upgrade typescript version in a SPFX solution? As part of SPFX development we try to install 3 rd party libraries, there is a possibility that we might face type errors. For example, if we try to install ANTD package as part of your solution and use one of its components and try to build the solution. You might be seeing the type errors (TS1005,TS1109) as shown below. Typescript errors How to find out the typescript version? When you build (Gulp build) the SPFX solution you will be able to find out the typescript version from the build log as shown below.  Steps for updating the Typescript version. In SPFX solution typescript version has dependency on the @Microsoft/rush-stack-compiler package version.  In the package.json if you have @microsoft/rush-stack-compiler-2.7 then the typescript version is 2.7.x.    In the SPFX solution deleted the node_modules folder. It will remove all the packages that are installed....

Add Items to sharepoint online List using powershell!!

SharePoint online provides only a small set of basic commands for writing powershell scripts. IF we have to do any operation using powershell we need to use CSOM or REST API.   Sharepoint patterns and Practises (PnP) team came with a powershell module for doing operation on the sharepoint online. Its very help full while writing scripts.   Similar modules exists for Sharepoint 2013 and Sharepoint 2016.   Link to the Github respositry. In the below article I will try to add items to a list picking the data from the JSON file.           Try to check whether SharepointPNPPowershellOnline module was installed or not. If not install it. # This script adds items to the list picking up the data from the json file. if (-not (Get-Module -ListAvailable -Name SharePointPnPPowerShellOnline)) { Install-Module SharePointPnPPowerShellOnline }           Get the data from the json file and store it in a va...