Questions tagged [promises]

Questions related to promise in terms of asynchronous calls

Filter by
Sorted by
Tagged with
0
votes
0answers
47 views

Promises resolving out of order

Environment SharePoint 2016 AngularJS 1.5.4 Situation I have a query service that wraps REST calls retrieving data from SharePoint lists. This service works without issue in SP 2013, but it is ...
0
votes
2answers
28 views

How to chain promises for multiple ajax calls to SharePoint to get user ids?

Broken promises, thought I had it figured out, still trying to get reliable results. Console log shows hit and miss results. Below is the rundown of what I'm trying to achieve. Is there a simpler way ...
1
vote
1answer
39 views

How to use Promise.all and ForEach to make ajax call per array item?

I have 2 arrays with email address that I want to feed to the function below, one after the other (not in parallel) and then perform a final function. I've been looking at examples trying to figure ...
3
votes
2answers
527 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 = ...
0
votes
1answer
103 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 ...
1
vote
2answers
101 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 ...
2
votes
0answers
75 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 ...
1
vote
1answer
786 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 ...
0
votes
0answers
39 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
249 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
751 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
79 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 ...
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="/...
2
votes
0answers
82 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
1answer
424 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 ...
4
votes
0answers
307 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 ...
0
votes
1answer
724 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....
1
vote
1answer
158 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
461 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
219 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 ...
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
2answers
987 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, ...
1
vote
1answer
318 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 ...
0
votes
1answer
332 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 ...
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 ...
3
votes
2answers
369 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 ...
1
vote
0answers
147 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 ...
0
votes
1answer
737 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, ...
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 ...
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 ...
0
votes
1answer
342 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....
5
votes
2answers
2k 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 ...
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 ...