Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 26 2020 12:51
    anna-talley unassigned #59
  • Jun 18 2019 13:42
    patrick-rodgers closed #830
  • Jun 18 2019 13:42
    patrick-rodgers opened #830
  • Jul 10 2018 12:58
    patrick-rodgers closed #751
  • Jul 10 2018 12:58
    patrick-rodgers closed #753
  • Jul 10 2018 12:58
    patrick-rodgers closed #758
  • Jul 10 2018 12:57
    patrick-rodgers closed #815
  • Jul 10 2018 12:57
    patrick-rodgers closed #823
  • Jul 10 2018 12:57
    patrick-rodgers closed #824
  • Jul 10 2018 12:57
    patrick-rodgers closed #825
  • Jul 10 2018 12:57
    patrick-rodgers closed #829
  • Jul 10 2018 12:57
    patrick-rodgers commented #829
  • Jul 10 2018 11:06
    Mike-tech opened #829
  • Jul 06 2018 18:26
    koltyakov labeled #828
  • Jul 06 2018 18:21
    ken-harris commented #828
  • Jul 06 2018 18:21
    ken-harris closed #828
  • Jul 06 2018 17:51
    koltyakov labeled #828
  • Jul 06 2018 17:51
    koltyakov commented #828
  • Jul 06 2018 14:23
    ken-harris opened #828
  • Jul 06 2018 13:18
    koltyakov labeled #827
Eirik Brandtzæg
@eirikb
dec is part of the guid. I can't see why it should fail.
jmls
@jmls
and now, of course, it's working with dec
wtf
I know I got an error because I was surprised
so, this was the error Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
jmls
@jmls
I wish I'd kept the stack trace now
thanks for the help - I do need to ask though, so an Id field can have a prefix like dec ? None of the other lists have such an id, and it's slightly concerning why this one does
Eirik Brandtzæg
@eirikb
dec is not a prefix, it's part of the guid
jmls
@jmls
ok, thanks
Ole Bergtun
@trillian74
i'm trying to move a file from one library to another library. Both libraries resides in the same subsite (yes i know... long story:) this is a legacy site from 2014). But i keep getting this operation is not supported error. Is it not possible to move files using pnp on subsites? file.moveByPath(`/sites/bms/procedures/archived documents/${fileref}`,true,true) file resides on same subsite but in another library...
Andrew Koltyakov
@koltyakov
What’s SharePoint version? ByPath is only available in SPO (and maybe in 2019). No such method in the API in older versions.
Ole Bergtun
@trillian74
It is SPO.
Ole Bergtun
@trillian74
i used another api: https://blog.velingeorgiev.com/createcopyjobs-api-copy-move-SharePoint-files-folders worked for me... don't know if this could be deprecated (hope not)
jmls
@jmls
is there any limit to the nunber of users returned by siteUserInfoList.items() ? I have a bunch of users that are not returned using this call, but all of them seem to have an id higher than 200 ish ..
it may be that items.getAll() is what I need . will check ;)
Andrew Koltyakov
@koltyakov
Default REST’s .top is 100, if it’s less then 5000 users, top can be established to a greater number.
Ole Bergtun
@trillian74

I'm moving some documents to archive on a regular basis... i'm experiencing some strange error when moving a file: Save Conflict

Your changes conflict with those made concurrently by another user. If you want your changes to be applied, click Back in your Web browser, refresh the page, and resubmit your changes. CallStack -- there are nobody touching these files right now? Have you guys seen this error? it's "old" files from 2015 (if we regard that as old:) ) I am using the CreateCopyJobs api for this. These files cannot be moved manually either.

Some ideas on where to look or mayby properties to check? (these files have had in-place record holds on them (no longer), but others that also had that were moved...) #lovinIt

Eirik Brandtzæg
@eirikb
Are there any locations to store arbitrary configuration/settings? We currently have a mix of SharePoint and CosmosDB (delivered through Azure Functions).
I've heard it could be possible to store setting (organization-wide, and user) in Microsoft Graph, is this true?
I noticed that Apps (we use multi tenant AAD App) have "Extensions", perhaps that's something?
Eirik Brandtzæg
@eirikb
Maybe this is what I want: https://blog.mastykarz.nl/easiest-store-user-settings-microsoft-365-app/
There's a magic path I can use: https://graph.microsoft.com/v1.0/me/drive/special/approot:/settings.json
But I wonder, must a user have special permissions to read this? (The blog post talks about writing, but only admins should do that in my case).
Eirik Brandtzæg
@eirikb
So far so fail: Special app folder seems to be personal, I can't put shared config in there.
Application extensions could have worked, but require Application.Read.All permissions. This permission require admin consent which is sad, but it also grants the acquired token access to all applications.
Eirik Brandtzæg
@eirikb
After some research I've decided to create my own config system.
Azure Functions. Decode + JWT token, extract tenant id and app id, use that as container and blob prefix, then fetch (and cache) json from blob.
Allow update based on Roles in AAD App (also in JWT). Clear cache upon save.
Eirik Brandtzæg
@eirikb
Is it possible to get the Teams link (link to a Teams) with SharePoint API only?
Eirik Brandtzæg
@eirikb
@koltyakov Do you think it would be possible (or too crazy, and way too late) to build a custom "sp.js"?
I don't mind sp.js, but it's a bit big, and has odd dependencies (not easy to use outside of SP).
The requests aren't very special it seems, some XML. I've tried making some manual requests and it works fine (as expected).
My idea is to write a simple generic handler, then use the types from @types/sharepoint to generate the rest, and use xml2js to create the XML.
I'm never going to do this, but it feels it would be really nice to have, or it would have been some years ago :)
Andrew Koltyakov
@koltyakov
Hey @eirikb, sorry missed lots of social messages recently.
Do you think there is a value in a separate library with JSOM nowadays? I mean for the relatively rare cases JSOM is needed you either load sp.js (no matter the size) or grab some methods XML packages to extend places where REST fails to provide a solution.
Anyways, if you have an idea how to generate JSOM XML in a generic and universal way I'm interesting to see it. As I did some CSOM XML generation for Go and there was something in PnPjs, however, I can't say that generated JSOM XML is a fun to maintain. =)
Eirik Brandtzæg
@eirikb
Many years too late to be sure. So not anything I'm planning to spend time on, just wondering aloud. But the TS types for sp are not that old, and it would have to be generated based on those.
From my small tests a lot of the XML isn't that important, and some parts that look magical can either be hard coded or simply removed.
Only reason to try this would be if TS types + tiny XML generation (recursively) could yield a working example. Like < 300 LOC and then generate the rest.
Benefits:
  • As you said, full support for all APIs. REST is getting there, but after many years it's still not 100% AFAIC
  • If you need sp, then you probably end up with these files: microsoftajax.js, init.js, sp.js, sp.runtime.js, and others when required, such as sp.taxonomy.js.
    Replace all of these with "neosp.js".
  • Better support of async/await and MSAL
  • GraphQL <- single requests to query data many "levels" down. The library API for this could be made very smooth.
onur-saf
@onur-saf
Hey i want to ask something about the library ? I realy tried hard to solve it but i couldn't :( . Can i use that PnpJS-Core which is not deprecated one in just & just & just React-App without SPFx thing.
Eirik Brandtzæg
@eirikb
@onur-saf You can use whole of pnp without SPFx
onur-saf
@onur-saf
I mean in development env ( include proxy ) i couldn't find any sample about that. Can you refer me an article if you know ? @eirikb
Eirik Brandtzæg
@eirikb
I'm not sure what you mean. What is a proxy?
onur-saf
@onur-saf
image.png
I'm using sp-rest-proxy in local development but i got this error
Eirik Brandtzæg
@eirikb
Ok, I'm not very familiar with that. The author @koltyakov is active here so he might know better.
How do you plan to deploy this? I just use MSAL (@azure/msal-browser)
onur-saf
@onur-saf
I created page layout that type publishing page and i changed the the content like <div id="root" /> which my react bundle refers in dom. Everything is okey in production, my requests success. but in development mode fails.
Eirik Brandtzæg
@eirikb
Because you don't have cookies (or auth token) locally.
The proxy thing is probably a solution. MSAL is another. If you are going to run directly in SharePoint then proxy is probably best.
Another option for you, a simple one, is to create a new page and point to your scripts on localhost
Andrew Koltyakov
@koltyakov
Hey @onur-saf you can take a look at generator-sppp. It scaffolds none spfx projects with react, pnpjs and proxy ootb. However, I didn’t update PnPjs dependency to the recent yet. Yet, using recent PnPjs is just easy as bump the dependency, remove it from webpack externals and import PnPjs due to the v2 partial import guidelines.
@onur-saf on your err screen you have conditional access lock error. You can’t workaround it rather than reaching your admins to provide you an allowed route. It can be addin only auth, user app password and allowence in cas for your user. Or none proxy but aad app reg and openidc driven client side auth.
as @eirikb mentioned
While in SPO, why you aren’t considering SPFx native approaches?
onur-saf
@onur-saf
hey @koltyakov i'll take a look about generator-sppp thanks :) and for your question i don't have permission to upload webparts in my organization
Eirik Brandtzæg
@eirikb
@onur-saf Have you tried doing what I said? Create a new page like your old one, a page layout, and point to your localhost JavaScript
onur-saf
@onur-saf
@eirikb yeap sorry for late response I'm doing like you said now it's solved my problem for now. Just i couldn't hot update automaticly sp page when i've changed my code locally :)
@eirikb thank you :)
Ochuwa
@ObomighieSophie_twitter
Good day, how do I make the submit button on a custom sharepoint form webpart built with react and spfx post data to an existing list on sharepoint
also how do I make 1 list work on multiple sites but only display some particular columns on each page
onur-saf
@onur-saf
image.png
Hello everyone again, I need a help about WebPartZone. I couldn't found any article or something helpfull. I need to render a WebPartZone in my reactjs application it's not SPFX Project. is it possible ?
Andrew Koltyakov
@koltyakov
Hey Onur! No, it’s not possible. WebPartZone is the server-side driven. You can render react app in a webpart zone, but can’t render webpart zone with a client side.
Ryan
@Doogibo_gitlab
Question for the gurus. I have a scenario where none of the options seem to fit perfectly. We have a .NET Web API hosted in Azure and need to use SharePoint for document management (custom web front-end also involved). Our tenant is large, and we are not allowed to use App permissions (which grant full control to all sites in tenant), we cannot use on-behalf-of flow, because one requirement is management of SP User Groups which again requires admin consent to a permission that is too broad ... is creating a user account and signing into SP directly from our Web API the only option? I don't see this scenario talked about often, and PnPCore, etc. require you to go the Azure App Registration route ... any other ideas? Thanks!
Ryan
@Doogibo_gitlab
It seems so bizarre that App Registration scopes do not provide more granularity. There are tens of thousands of SP Sites in our tenant, we cannot safely consent to the scope that gives Full Control over all sites (though this would make life easier) ... hopefully one day they let you specify a particular site/site collection.
Ryan
@Doogibo_gitlab

https://www.leonarmston.com/2021/03/testing-out-the-new-microsoft-graph-sharepoint-specific-site-collection-app-permissions-with-pnp-powershell/

Just found that. Wow! Still requires admin consent... but seems like I'll have an easier time getting that granted.