Use the JSOM to retrieve, update, and manage data in SharePoint.

learn more… | top users | synonyms

0
votes
2answers
25 views

Performance: Shall I use caml query or loop to get the item count

I have a list which is use to store the users response from a polling app. The list saves response in the following format: QuestionId | optionChosen I want to show the users count against each ...
1
vote
1answer
13 views

how to use JSOM to modify permissions for multiple list retrieved by a CAML query

Using SharePoint 2010 JSOM I know how to get a list item by it's ID, break its inheritance, then add a user to it's permission list with contribute access. What I cannot figure out is if I get ...
1
vote
1answer
17 views

Retrieve List/Library “Shared With” Users and Groups using Javascript

I can retrieve Shared With info from a SharePoint 2013 (On Premisses) List/Library (not an item) using Javascript? I thought it could be available through ...
0
votes
2answers
17 views

Add list item using JavaScript request failed

I am trying to add a folder to a library on my site, however I am finding it extremely difficult to complete such a simple task. The function executes properly (no errors or exceptions) however the ...
1
vote
0answers
19 views

Trouble uploading file to Document library using REST api and JSOM

So I have been trying for the last day or so to get code right to upload a file to a newly created document library based off a custom template. Based on my research I know I am getting all of the ...
2
votes
0answers
16 views

How to make getpeerurl function always work even if ribbon is hidden in JSOM?

I want to use the getpeerUrl SharePoint 2013 function in JSOM to get the other variation URL for the current page. I have a solution here ExecuteOrDelayUntilScriptLoaded(function() { ...
0
votes
2answers
38 views

running async calls in sequence

Hi I believe I need to execute the following code in sequence otherwise if lists get long I may get errors because one async call may affect the other. I have two cascaded async calls. I have only ran ...
0
votes
0answers
21 views

How to get the SPListItem of a lookup field without having the SPList in the scope?

I have a SPList "TeamAreas" where every SPListItem is a "TeamArea" with the fields "ID", "ParentTeamArea" and more.To get the SPListItem for the "ParentTeamArea", I tried to use var parentTeamArea = ...
0
votes
1answer
19 views

404 Missing jQuery in _layouts folder

I have been stuck for a while trying to find out what exactly the _layouts folder does for SharePoint and why it may be causing any script I write and attempt to deploy on the site to not work. They ...
0
votes
1answer
10 views

JSOM duplicate folders

i'm creating folders in sharepoint online using JSOM. And experiencing kinda funny behavior, when folders are created with duplicate with some kind of timestamp as suffix to the filename. Ie. ...
0
votes
0answers
12 views

JSOM column creation in host web doesnt work

I get an error (the error message is empty but it doesnt work) with this script for creating a column on a SharePoint host web. <script type="text/javascript"> var clientContext = new ...
1
vote
0answers
18 views

SharePoint 2013 - Add-in - JSOM - Create SharePoint Group

I am trying to create a SharePoint Group in a SharePoint Add-in, which has Full Control over the site collection, using JSOM. Here is my code: function createGroup(groupName) { var ...
1
vote
1answer
46 views

Iterate subsites lists

The code below iterates subsites and finds a lists called TeamRequests in each site. At the moment it only displays the 1st item of the list. I'm trying to alter the code so it iterates all the items ...
1
vote
0answers
17 views

Get context from admin-site on a sitecollection

How can i authenticate my administration site, and get that context from a sitecollection? My current code is below var ctx = new SP.ClientContext("https://tenant-admin.sharepoint.com"); ...
2
votes
0answers
28 views

Update profile properties jsom

I can update my own profile properties but i cant update other users profile properties. When i do i'll get an "you are not authorized.." error. I have administration rights. Here is my function to ...
4
votes
0answers
30 views

How to find the last Logged-In time for the external user for a Sharepoint online Site?

I need to know about the information for the external user last logged-in time over a site. Is it possible to get through REST or Client-Object Modal?
1
vote
1answer
54 views

Loop function calling async function

Someone mentioned that calling cascaded async functions don't work. However I'm trying a simple test with a for-next loop and getting unpredictable results. The console.log always shows the last item ...
0
votes
0answers
33 views

multiple async calls issue

Hi Using SharePoint 2010 and making what I think is a chained call. I've inserted another call in the succeed method of the first that also creates another async call. Is this correct? The developer ...
0
votes
0answers
7 views

Create initial actions on App-Installation (SharePoint hosted)?

I want to offer a SP2013-AddIn that should do some action upon installation like creating SharePoint-Lists, displaying a wizard (where default configuration settings can be entered) and so on. Is ...
1
vote
0answers
17 views

Create custom site template with JSOM?

I understand that I can create subsites on the hostweb of O365 using JSOM and use custom site templates for that. One (out of many) examples for that can be found at Code Project Now my question is: ...
0
votes
2answers
43 views

SP.UserProfiles - get all properties available for user

Since I do not have access to the SharePoint farm. Is there any way to retrieve all available property names from UserProfiles in SharePoint 2013 through JavaScript? What I was looking for is the ...
0
votes
0answers
22 views

How to create/add same list columns to another existing list content type programatically?

I have a requirement that to append the list columns with field references. I have List Content type A and the same List Content type A in another site. I need to append the newly created columns of ...
0
votes
1answer
32 views

Mix CSOM and JSOM? Any disadvantages?

I need to write an Office365-App. I want to use a provider-hosted MVC-Application for this. As I want to use some kind of "API" on some pages, that returns a JSON that then is used inside JS to ...
0
votes
1answer
22 views

How to render filtered data in SharePoint list using JavaScript or JSLink

I have a custom list and I have to render filtered data dynamically. The scenario is, I have some SPGroups i.e. (Requester and Approver). If the current user is in Requester group then I have to show ...
1
vote
2answers
46 views

Displaying All sites a User Has access to, Across an Entire Web Application!

I have had this issue for a while, and been asking piece-meal questions for a few weeks. I finally created a full solution that worked. And wanted to provide the full solution, that was both EFFICIENT ...
1
vote
0answers
25 views

JSOM: Can we query Renditions?

Can we use Javascript Object Model to query site renditions available in SharePoint 2013? If yes, I couldn't find an example how..
2
votes
2answers
50 views

Paging, sorting and filtering on multiple libraries in a site collection

I have 10 document libraries sharing a common content type say 'contenttype1'. I want to have a page where I would list all the columns as filters to the users if the user selects any value for a ...
3
votes
1answer
124 views

'ctx' variable in SharePoint

Recently I came across the variable ctx (link) in SharePoint which allows you to get the name of current list/library without any fuss. Apparently the ctx variable has quite few more tricks up its ...
5
votes
1answer
240 views

How to get the current list/library name using JSOM?

How to get the current list/library name using JSOM? So far I found two snippets which return GUID of the current list/library, but not the name. // Using standard JSOM ...
1
vote
1answer
66 views

executeQueryAsync don't behave as synchronously

I am creating different forms where I need same functions, so I created separate js file which I call on my each forms. In below code if alert currentUser from success method then I get the value but ...
2
votes
2answers
75 views

Basic add list item with JavaScript problem

I am trying to create a list item with JavaScript, but have been having problems. To try to simplify things, I created a simple list called "Test List" with one column, "Title" and created a script ...
1
vote
1answer
23 views

Add user to group error - Code

I am getting an error when trying to add a user to group in JavaScript, here is my code below: user = web.ensureUser("domain\\natalie"); membersGroup = web.get_siteGroups().getByName("site ...
3
votes
3answers
109 views

Query multiple lists using javascript/CSOM

I'm about to query multiple lists using JavaScript (JSOM, SharePoint 2010). It's working when querying one list in a time, but that's annoying when I'm having lots of lists. Working example: ...
3
votes
4answers
153 views

Get item count of a list without getting all properties

I want to get the item count of a list, so my code looks like this: var list = context.get_web().get_lists().getByTitle("tasks"); context.load(list); Doesn't this way retrieve all properties for ...
2
votes
1answer
41 views

Uncaught Error: Incorrect usage of exception handling scope

I am trying to implement try/catch scope in my JSOM, but I am getting the error message in the question's title. Below is my code: errScope = new SP.ExceptionHandlingScope(context); ...
1
vote
2answers
54 views

Retrieve my personal site url

This code retrieves my property values succesfully except my "PersonalUrl" property. If i cant retrieve it with the PeopleManager object, is their any other options to retrieve the personal url ...
1
vote
2answers
43 views

How to focus field when opening modal dialog

If I have a modal dialog which looks like the following, how can I focus the textarea after opening the dialog? By simply adding $('#txtArea').focus(); after the code, the txtArea has focus for only ...
0
votes
1answer
32 views

Executequeryasync in foreach loop

I need to store all the properties for all the users in an array. How can I achieve this, with the executequeryasync method inside my foreach loop? var profileProperties = []; ...
1
vote
1answer
25 views

Get a specific item from the return

I have some javascript which is looking to a list, it returns more than one result. I want to be able to store each result in its own object. How can I do this? Please see my code for illustration ...
3
votes
2answers
50 views

Object Doesn't support property or method '$1X'

I am using JSOM in Nintex Forms 2013. My script includes are /_layouts/15/sp.runtime.debug.js /_layouts/15/sp.debug.js /_layouts/1033/init.js /_layouts/MicrosoftAjax.js /_layouts/sp.core.js ...
1
vote
2answers
84 views

JSOM: Fastest way to get count of list items in a view

My current JavaScript implementation is based on answer in How to get all items in a View using Client Object Model (JavaScript). Is there a way to avoid loading the view first? Also, I am not ...
1
vote
1answer
164 views

Set list item level permission in jsom (javascript object model)

I need to assign permissions to a particular list item using client object model in JavaScript.Say for 5th item by id I want to assign contribute permission to a particular group. I have previously ...
0
votes
0answers
18 views

Is O365 (SharePoint Online) Visitor Group able to browse the groups and members?

i have a general question on browsing groups and members in O365. For example my user is in the Visitors Group. Would he be able to read alle the Web or even SiteCollections SharePoint Groups and list ...
0
votes
1answer
72 views

How to get Term via multiple custom properties through JSOM?

I am trying to get terms by multiple custom properties via JSOM. For example: i have a term with always two custom properties TABLENAME DB_ID I want to query a TermSet or filter a TermCollection by ...
3
votes
2answers
48 views

How to seen all JSOM internal fieldnames not DisplayName of Column of the list?

I know to get the Internal Fieldname from URL. But that takes long time and status bar is not always full with the url, so you have to open ze field and see in the top url what the internalfield name ...
3
votes
2answers
121 views

how to get a list's add new item URL with JSOM?

I'm trying to figure out how I can get a list's add new item URL using JSOM in SharePoint 2010. This is what I have so far to get if the current user has edit access on the list. ...
0
votes
1answer
34 views

Link to cross domain images from SharePoint online app?

I've created a simple employee photo directory app for SharePoint Online (O365), packaged and deployed the solution as a SharePoint app. The lists and libraries where I'm getting my data from exist ...
0
votes
1answer
34 views

Change Subsite URL in SharePoint 2013

I have a subsite called blogsite and the URL looks like this: http://abc/sites/SiteCollection/blogsite I changed the URL by mistake as Home.aspx by navigating to the URL ...
1
vote
1answer
83 views

How to use JSOM/CSOM in SharePoint 2010 to get information about the current user like department, title, manager and phone number

I've seen how to get information about the current user using CSOM/JSOM from Get current user in Client Object Model with javascript? but I can't figure out how to get other properties like: ...
1
vote
0answers
96 views

Remove list item permissions by role type using JSOM

I'm looking for a good way to remove all list item permissions on a certain list item of a specific role type using the JavaScript object model. With ...