New answers tagged

0

You don't need to change the definition of the getItems function at all. As it is written, you actually have two different options. The way that method is concatenating filter strings together, you can just specify to criteria in a single parameter, for example: this.getItems(mylistguid, myctid, "firstnamecol eq 'Alice' and agecol eq 27"); But that ...


1

Finally I got the solution for my question. Instead of Using files.add in sp-pnp-js am used addChunked Method. Refer This Link. Using addChunked method we upload the files as number of little blocks sized 10MB. Using Total number of blocks, add some javascript code to convert percentage.


0

An interesting approach is to use UI Fabric controls that are more consistent with the SharePoint Online design. There are different progress controls: ProgressIndicators, Shimmer, Spinner. Best suited to your needs is ProgressIndicators, but it does not allow you to display the percentage as it is implemented by default. Control behaviour in action here. ...


3

Your render method is trying to render the entire assignee {assigne}, but React doesn't know how to render that object. Try changing your render to: <div className={styles.CellStyle}> {this.state.ListItems.Assignee.map(assigne=>{return <li key={assigne["odata.id"]}>{assigne.Title}</li>})}</div>


0

I was unable to solve this problem, I suspect it is due to function calling another function caused error. I attempted to put debugger, if there is value just a mouse over would show but it didn't. response.json().then((json: any) => { if(json.value && json.value.length){ debugger; // it skipped here this.data.push({ city: ...


1

Inside for loop in second SharePoint REST call you need to pass the index (i) to get the Title, like below: temp = json.value[i].Title; Also, as you are using $top=1 so it will return just one item at a time. So, you don't have to use for loop in both cases. In Success function, you use it like: response.json().then((json: any) => { if(json.value &...


1

Theoretically, you should be able to leverage the processQuery rest endpoint, and perform a query like the one below, in order to update a site custom property bag: import { SPHttpClient, SPHttpClientResponse, ISPHttpClientOptions } from '@microsoft/sp-http'; [...] let myPropertyBag ="customPropbag1" let myNewPropBagValue ="new value" ...


5

You will need to do both the REST orderBy, and then use JavaScript to reverse the array of items in the returned results. The problem is thus: In order for the REST API to return only the n most recent items, you have to provide the ODATA orderBy the created date in Descending order. But, if you want to use or display those same n items in any other order ...


1

We can also use caml query to get the 50 items and sorted. Below is not an exact working code, I haven't tested, but it will give you an idea to implement it. const xml = "<View><ViewFields><FieldRef Name='ID' /><FieldRef Name='Title' /></ViewFields><Query><OrderBy><FieldRef Name='Created' /></OrderBy>&...


1

Try using below if this works for you: const items = await this.spClient.web.lists.getByTitle(this.spList).items .orderBy("Created",true) .top(50) .get(); For descending order you can use orderBy("Created, false). Update: As @willman mentioned, You need to get the data in reverse order using orderBy("Created, false)...


Top 50 recent answers are included