SPServices




Parse SharePoint lookup value with JavaScript and Regular expression

Javascript logo

If you use SharePoint and get data from lists with JavaScript, once you will receive SharePoint lookup value which looks like '34;#Item title'. There is a way to parse this data with Regular expression and to convert it to an object.

I have created a small method to make it easier. In my case I have got values from parent list of employees. My method returns an object with properties 'id' and 'fullname':

Console.log() function stops JavaScript executing in Internet Explorer 10

jQuery logo

Strange behavior of console.log() I have noticed when I created a JS code for SharePoint page. My code used jQuery and SPServices library. The code used to get items from a list and render options for "select" control.

Below I post a part of my function which fills a JS array and renders options for "select" control.

(read more...)


MarkiMarta.com. Notes of web-specialist
Since 2009
18+