Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [promises]

Questions related to promise in terms of asynchronous calls

5
votes
2answers
1k views

Client Side Rendering with Async dependencies

In my display template I want to render a field in different ways based on the user's group membership. The information about the group membership comes from an async ajax call (jsom or rest) What I ...
4
votes
0answers
294 views

Using JSOM calls with Angular 4

I have to port an AngularJS app to Angular4 which now uses promises and have no clue how I can use this with the executeQueryAsync() method from JSOM. I have also not found any documentation to this ...
3
votes
2answers
486 views

How to use jquery promise in JSOM

I have code like this (Default.aspx): <asp:Label id="LabelA" runat="server" Text="0"></asp:Label> <script type="text/javascript"> document.getElementById('LabelA').innerHTML = ...
3
votes
2answers
354 views

Problems getting executeQueryAsync to work with Promise

I am busy with a piece of javascript which has problems working correctly. I am trying to work with a loop which contains an executeQueryAsync. When this one is executed it doesn't go straight to the ...
2
votes
1answer
3k views

Using promises with executeQueryAsync results in error

I'm pulling information from an Excel spreadsheet and trying to check the rows against data from a SharePoint list to find duplicates. The executeQueryAsync() in the itemIsDuplicate() function is ...
2
votes
0answers
71 views

TypeScript and SharePoint Framework question - although works but does it represent correct design?

Thanks for reading my question. I am just beginning to learn TypeScript and from my understanding so far I have created the follow code to retrieve list items from a list. The code works but I am not ...
2
votes
0answers
74 views

Custom Form Rendering RegisterTemplateOverrides in a promise issue

Using custom form rendering with JSLink, I fetch some data in promises before I attempt to do: SPClientTemplates.TemplateManager.RegisterTemplateOverrides(context); However because some of the ...
1
vote
2answers
91 views

How to perform nested CAML operations using promises?

Team, I have 3 lists, (a) Issues (b) Risks (c) Incidents. I want to... 1 - Run a CAML query against (a) Issues list to get all the issues not closed. 2 - then run a loop through the titles, and use ...
1
vote
1answer
433 views

Can I check out, update, and check in with 1 REST call?

I am trying to use REST to update a list item but the library has forced check out enabled. Does this mean I need to make 3 rest calls for each item I was to update?
1
vote
1answer
213 views

SP Online - Use promises in SharePoint-Hosted Add-in

I want to know what is the best way for using JS chaines promises in for SharePoint-Hosted Add-in. In my code: I have a pageLoad function that's getting data from SP and I want to execute pageLoad ...
1
vote
1answer
401 views

Using SPServices with Datatables: Table loads before SPServices GetListItem call is finished running

I'm using DataTables to display data from a list. I'm providing the data to DataTables from a SPServices GetListItems call. I had everything working fine, but a recent modification I made to the code ...
1
vote
1answer
1k views

SharePoint JSOM and Promises - copying items from one list to another

I need to use JSOM to copy a set of items (found from a CAML query) from one SharePoint list to another. I'm pretty experienced doing this type of thing on the server side, but relatively new with it ...
1
vote
1answer
629 views

SharePoint Framework - basic read list items using typescript

I have a question on the following code. All of the code is taken after reading through various get started samples and then tweaked it a bit. I am trying to figure out how it works which is straight ...
1
vote
0answers
3k views

Javascript: How to convert [object promise] to a value

I have a list with 2 columns Title and ID. I would like to get the Title based on a unique ID (101) value and insert it into a textbox Test. Here is my code: <script type="text/javascript" src="/...
1
vote
1answer
146 views

Batch operation not following order

I've written a function using pnp-js-core to batch checkout, update and checkin selected items. Problem I'm seeing however is that it seems that by the time the first map is called the next one ...
1
vote
1answer
317 views

SP 2013 How to load PeoplePicker value into promise?

I'm using the SP PeoplePicker posted in this Microsoft article: https://msdn.microsoft.com/en-gb/library/office/jj713593.aspx But how can I load the user ID's into a promise? I'm not familiar with ...
1
vote
0answers
145 views

Call JavaScript Function after list data has successfully updated via quick edit

I am trying to call a custom JavaScript function after content is saved into a list via quick edit. Once the data is saved, I would like to make an AJAX call to get the newly updated items. I do not ...
1
vote
0answers
33 views

Function call in selection event

I want to call the following function in a selection event function name calcDay(). var p = getList("Compulsory Leave"); When i put it inside the selection event function it generated error : p is ...
0
votes
1answer
74 views

Javascript, promise, when all operations are done [closed]

I'm saving list items using promise in a loop and it works just fine. When all items are saved I want to execute some code using .done(function()). But how? My code below executes "done" directly ...
0
votes
2answers
931 views

Using SharePoint 2013 PeoplePicker with jQuery promise

So with the help of Suresh C I tried to get multiple Id's at once from the PeoplePicker SP app. Standard code only gives out the Id of the first user. I'm going thorugh my code over and over again, ...
0
votes
2answers
1k views

Loading image freezing with Javascript Object Model and jQuery Promises

I have some code using the javascript object model to get items for several dropdown boxes on a form. I also heard that using Promises was the way to go for speeding up things and created 2 wrapper ...
0
votes
1answer
323 views

SharePoint Apps and Promises / Deferred when performing work on data

I have found allot of resources which point out how to handle a simple promise or deferred Async call in SharePoint apps. (for example) But I cant understand how to properly use a promise if I am ...
0
votes
1answer
735 views

JSOM: Limit calls to SP.ClientContext executeQueryAsync with promises (Angular example)

I have asked myself this question several times before: Is it possible to have a JavaScript function used multiple times from multiple locations returning a promise calling ctx.executeQueryAsync, ...
0
votes
1answer
74 views

sharepoint pnp calls returns undefined even before calls to SP finishes

I am working in an spfx project and i need the user ids of the users from the SharePoint persona people picker of fabric ui. here is what i have so far. component that calls the function: let ...
0
votes
0answers
36 views

Deferred Promise not working inside asynchronous function

I want to sum the amount of multiple rows/entries having the same request ID(common column) for the current User. To achieve this, I am trying to retrieve a list, On successfully retrieved I pick the ...
0
votes
1answer
221 views

CAML QUERY for getting only tasks of current user

I want to show the user only his tasks on specific list, and show him the option to approve and reject from that view. In order to get his tasks I have used the below code: var ...
0
votes
1answer
687 views

Internet Explorer 10 Script7002 XMLHTTPREQUEST network error 0x800c0007, no data is available for the requested resource

I am not sure wha is going on here but I am repeatedly receiving this error when trying to use the REST API when saving a form. I make the $.ajax call, wait for the promise to return but at some ...
0
votes
1answer
635 views

SharePoint framework and typescript promises

I need some help regarding Typescript. I was following a tutorial which pulls search data in client side web part. The code for the service is as follows (it works): const _results:SearchService....
0
votes
2answers
1k views

Populate person field of custom list via REST

How do I get the values of get_id() function into person/group field via REST? I know the syntax of the REST part has to be like: 'AssignedToId': {"results": [ID1, ID2,...]} But how do I load the ...
0
votes
1answer
339 views

SharePoint App Crossdomain Rest function rewritten as a Promise

I have written a successful crossdomain call using Rest which is hosted in an Menu Action App. It returns all document item properties. Ok now I think is the time to rewrite as a JavaScript" Promise....