Geeks With Blogs
Thorvald Bøe REST
Create a multi line rich text field in a SharePoint list using REST
I recently needed to create a rich text field in a SharePoint list programatically. Since I am using REST all over the place, it would be practical to continue that now as well.I was able to find out how to create a new field. It is done by posting to this url: reqUrl = appweburl + "/_api/SP.AppContextSite(@t... + listName + "')/fields?@target='" + hostweburl + "'";For example like this:$.ajax({ url: reqUrl, type: "POST", data: "{ '__metadata': { 'type': 'SP.Field' }, 'Title': ......

Posted On Thursday, January 14, 2016 12:32 PM

Creating a SharePoint list item from an app/add-in part - fun with form digest
Ok, I will try not to make this a rant, but after knocking my head against the proverbial wall for several hours, that is going to be a tough one, LOL.The problem was seemingly trivial: Create a SharePoint hosted add-in part with a button that creates an item in a list in the host web.After all, I have been working with list items quite a bit from the SP hosted add-in, so doing it from an add-in part should not be so difficult, right? Wrong!As you might know, when modifying a sharepoint list (e.g. ......

Posted On Tuesday, October 6, 2015 8:48 PM

How to upload files to a SharePoint 2013 document library using jQuery
I found a great code sample on how to upload files to a SP 2013 library using javascript/REST.The code worked like charm with almost no modifications - just had to change the input control name and the document library name and type. Thanks to Rob Windsor for providing the sample!Note: Requires html5 support, will not run in older browsers.The original article is here: http://sharepoint.stackexch... is the sample code:function ......

Posted On Friday, June 6, 2014 11:57 AM

SharePoint REST - adding list items with lookup columns
When working with SharePoint and REST, you will sometimes need to update list items that contains lookup columns.This is quite straightforward as long as you know how the lookup value is represented in the json string. However, the problem occured because I had worked with lookup columns just many enough times to not give much thought to the process of creating them, and just too few times to have experienced this situation before.The thing is that when retrieving list items with lookup values in ......

Posted On Tuesday, March 11, 2014 4:12 PM

Display in image from a picture library in SharePoint 2013 using Javascript and REST
Having jumped on the SharePoint bandwagon not too long ago, means that sometimes you end up in a situation where you are "just going to do a simple thing" and it turns out that:a) It is not so simple, andb) Finding information is even less simpleI often find myself in this situation, and since I don't have a decade of SharePoint experience to fall back on, I will have to rely on my old friend Google. Fortunately we have a long and understanding relationship, and even though this time it was harder ......

Posted On Tuesday, January 28, 2014 10:03 AM

Javascript and SharePoint rich text fields
When programming against SharePoint using Javascript and REST, there is a little gotcha when using the "multiple lines of text" type in a list. When retrieving a value for this type of field, the result is by encoded to support rich text, like this:If you want to simply retrieve and use the text value, you've got a problem. My first thought was to decode the string using some kind of jquery method. This is not so simple as it seems, and while there are ways to get it done, you will still be in trouble ......

Posted On Thursday, January 9, 2014 3:57 PM

Nested promises...
The title of my first blog post could possibly have been taken from a poorly written love song, but it's not. Instead it is from some (hopefully not so poorly written) javascript code.Ok, so this javascript world is kind of new to me. Not that I haven't used javascript for the last 13 years or so, it's more that my acceptance of javascript as a full fledged development tool is kind of new to me. With javascript libraries popping up all over and it being promoted as a knight in shiny armour to recue ......

Posted On Wednesday, November 20, 2013 4:11 PM

Copyright © Thorvald Bøe | Powered by: GeeksWithBlogs.net