Skip to main content
Share Your Experience: Take the 2024 Developer Survey
5 votes
Accepted

REST call "d/results" vs "value"

I think I got it. The ACCEPT header parameter "odata = verbose" makes all the difference. Using it returns the "d/results" path. Not using it returns "value" path. I ...
Aamir's user avatar
  • 411
5 votes
Accepted

Updating SPFX breaks gulp

In 1.6.0 projects the config/tslint.json file was removed and a new one is created at the root of the solution. Delete E:\DevEnv\WebParts\react-full-iframe\config\tslint.json. You should also add the ...
baywet's user avatar
  • 565
5 votes
Accepted

REST API How to retrieve the ID of a newly created file

This will return the ID: /siteURL/_api/web/lists/getbytitle('Documents')/Items?$filter=FileLeafRef eq 'AdventureWorksBikesWithDetails.xlsx'&$select=Id This will return: { "d": { "...
Mike Smith - MCT's user avatar
4 votes
Accepted

Get value from JSON from SharePoint REST

The ID is an object property, so you need to access it like an object property using the square bracket notation instead of dot notation: var array = ["ID", "Title"]; data.d.results[i][array[0]]; ...
Mihail's user avatar
  • 2,079
4 votes
Accepted

Get other field value in JSON column formatting

I've also come across this issue, and although I don't claim any particular expertise, it appears that you need to have the referenced field available to the selected view. Paul CJ
Paul CJ's user avatar
  • 78
4 votes

REST calls to different items of single lib return responses with different structures

It seems that you are not sending the same Accept header in all GET requests. You can set Accept header to: application/json (your second response) application/json;odata=nometadata application/json;...
Lukas Nespor's user avatar
  • 1,661
4 votes

When I open my list on sharepoint, it always opens in quick edit mode. How can I fix this?

It seems that your default view is created using datasheet mode, try to create a view using standard template and then set it as default view. It will no longer open in quick edit mode.
Deepmala's user avatar
  • 1,857
4 votes

JSON control if @currentfield is empty

You can achieve this using a style tag with a conditional, see below: { "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json", "elmType": "a", "txtContent": ...
Brian J. Evergreen's user avatar
4 votes
Accepted

Using JSON Formatting Inside Web Parts

Give this a try: { "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json", "elmType": "div", "attributes": { "class": "=if([$Days_x0020_In_x0020_progress]...
theChrisKent's user avatar
  • 6,011
4 votes
Accepted

Rest API Post Request Returns '403 Forbidden'

You can directly use the FormDigestValue in the RequestDigest header in Modern pages. The __REQUESTDIGEST is a hidden HTML element which is not present in modern pages. So, it had tripped up your ...
Gautam Sheth's user avatar
  • 30.9k
4 votes
Accepted

How to utilize if/else condition for JSON column formatting in SharePoint?

You can do it similar to that in Excel :) You can checkout the below sample to get an idea: "background-color": "= if([$OtherColumn] == 'Red', 'red', if([$OtherColumn] == 'Green', 'green', if([$...
Gautam Sheth's user avatar
  • 30.9k
4 votes
Accepted

How to display Persona Card on hover in list using Sharepoint Online view formatting?

Use the defaultHoverField property in JSON as described here: Use column formatting to customize SharePoint
user90476's user avatar
3 votes
Accepted

What is the json syntax to insert an item to a list?

Your JSON for updating list item should be like this. { "__metadata":{ "type":"SP.Data.YourListNameListItem"}, "securit_x00e9_":"test", "column":"test", "numero":"test", "Title":"test" } In type ...
Aakash Maurya's user avatar
3 votes
Accepted

How to update list item with lookup (People and Group) column using REST post method

I guess you are missing something in this step. var addData = { __metadata: { 'type': 'SP.Data.GNPagesListItem' }, Title: data.Title, Description: data.Description, ProsessOwnerId: data.ProsessOwner, ...
Nagarajan Muthukumar's user avatar
3 votes

Tool to inspect json data returned from REST API call to Sharepoint online/Office365 Sites

Login with the credentials of SharePoint tenancy and make sure your user is authenticated to do the operation. I prefer chrome to this operation and recommend to use "Advanced REST client" or Postman ...
Kushan L Perera's user avatar
3 votes
Accepted

JSON conditional format column based on choice from another column

If the source column allows multiple value selections, SharePoint stores those selections as an array of values inside the field. Therefore, matching on a single string value will never succeed ...
willman's user avatar
  • 3,724
3 votes
Accepted

How to increase font size of displayname titles when it comes to JSON formating?

Unfortunately, there are no formatting options available for the form body. The only options are the sections, their names, and the fields for each as you've already got.
theChrisKent's user avatar
  • 6,011
2 votes

Why can't my value pass through JSON to SHarepoint list?

Two things: Your metadata type is wrong. It should be SP.Data.ChangeOfAddressListListItem. The format is SP.Data.(list name)ListItem or SP.Data.(library name)Item when adding or updating an item. You ...
Rob Windsor's user avatar
  • 12.7k
2 votes

Security exception when trying to use JavaScriptSerializer

The way I worked around this was to abandon using the Microsoft JavaScriptSerializer class, and instead use the Json.NET open source library. You can add it to your VS project using NuGet package ...
Dylan Cristy's user avatar
  • 12.7k
2 votes
Accepted

Retrieving List<T> collection from a REST method within a SharePoint 2013 Workflow

Found the solution... Check out the steps below: First retrieve the JSON (shown above) to a DynamicValue (i.e. ResponseDV) through an HttpSend activity. Use an GetDynamicValueProperties activity and ...
Muhammedh's user avatar
  • 1,157
2 votes
Accepted

Retrieve the Item ID from the Task List Related Item column

Base on your code, the value you get is a string not an object. so the code : var relateditmid = relateditm[0].ItemId; will return the item ID after converting the string relateditm to Object using ...
must19's user avatar
  • 748
2 votes

Choice field values returning as string with "\n". How to get collection?

One option would be to convert search value (SPKeyValue type) into choice field value (collection(Edm.string) type) once the search results are returned. JavaScript example function ...
Vadim Gremyachev's user avatar
2 votes

How to GetListItems as JSON using Powershell with SharePoint Online?

Not PowerShell, a manual way, easier for a one of.. Open a ListView page, displaying all the Items and Fields you need Open F12 Dev tools execute JSON.stringify( ctx.ListData ); in the console ...
Danny '365CSI' Engelman's user avatar
2 votes
Accepted

Displaying an image from a SharePoint list using Javascript building strings

ID's should be unique,, use class if you want to use the same properties on multiple elements. In HTML Change <div id="deviceimage"> to <div class="deviceimage"> In JS Change ...
Marko Tica's user avatar
  • 2,537
2 votes
Accepted

Swapping an object into an image using Javascript onload

For this, you can make following change in your code. HTML Add a container for your image holder, e.g. <div id='imageContainer'></div>, where you want to display the image. JS After ...
ThinkB4Code's user avatar
  • 2,970
2 votes
Accepted

How to GetListItems as JSON using Powershell with SharePoint Online?

Your approach is totally ok. You should change a couple of things to make it work: For each list item create an object that has all the properties that need to be in json file, put it in the list ...
Damjan Tomic's user avatar
  • 3,656
2 votes
Accepted

Submitting input from HTML Form to a SharePoint list without using Infopath

Found the answer on this page. Thanks for your input. It appears that the error occurs because the form digest has been expired on the page. so i used these functions var webUrl = "https://weburl" ...
ShanayL's user avatar
  • 151
2 votes

How to convert CAML query results to JSON with JSOM without looping

Umh, afaik that's not possible. I don't know your reasons for why you can't use REST, but you could try looking into the onExecutingWebRequest etc on the SP.ClientContext object and abort the initial ...
Anders Aune's user avatar
  • 6,268
2 votes

Get other field value in JSON column formatting SharePoint Online

Microsoft block the execution of custom markup in calculated fields in SharePoint Online from June 13, 2017 onwards. You can use the JSON to format the “CAI Vendors” column. Enter the following JSON ...
JoannaW_MSFT's user avatar
  • 6,621
2 votes

How to get ErrorCode value using jQuery from bellow SPServices xml response

If you want to iterate through the results looking for any errors, then use something like this: var xml = $($.parseXML( yourXMLstring )); var errors = xml.find("ErrorCode"); for (var i=0; i<...
Mike Smith - MCT's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible