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
jmls
@jmls
hmm. did _vti_ pascal case the friendly name, or did that use internal as well ?
jmls
@jmls
another odd question: I have a list id of 'dec72266-3364-4337-94eb-c6237d8dddca' where this list was created from a template. However, if I try and use this id as the guid , sp bombs out saying the it's not a valid guid (no shit sherlock ;) )
sooo, how can I reference the list using the id above ? Or is the id incorrect - and if so, how does that happen when the list was created from a template
jmls
@jmls
I can see from the sharepoint url this id is being used : layouts/15/ListEdit.aspx?List={DEC72266-3364-4337-94EB-C6237D8DDDCA}
Eirik Brandtzæg
@eirikb
I'm not sure what you mean, don't you use this : https://pnp.github.io/pnpjs/sp/lists/#get-list-by-id ?
jmls
@jmls
yes, I do - but the actual list id is dec72266-3364-4337-94eb-c6237d8dddca - which when I try and use get-list-by-id it falls over complaining that the id is not a guid
Eirik Brandtzæg
@eirikb
Well it's not. You say this is the ID, but you only think this is the list ID because that is the ID in the template?
You can print all IDs to see the actual id.
Something like console.log(await sp.web.lists.get())
jmls
@jmls

so, if I have this code

        const result = await sp.web.lists.getByTitle(title)();
        console.log(result);

I get this result

[snip}
  FileSavePostProcessingEnabled: false,
  ForceCheckout: false,
  HasExternalDataSource: false,
  Hidden: false,
  Id: 'dec72266-3364-4337-94eb-c6237d8dddca',
  ImagePath: {
    __metadata: { type: 'SP.ResourcePath' },
    DecodedUrl: '/_layouts/15/images/itgantt.png?rev=43'
  },
  ImageUrl: '/_layouts/15/images/itgantt.png?rev=43',
  IrmEnabled: false,
  IrmExpire: false,
  IrmReject: false,
  IsApplicationList: false,
  IsCatalog: false,
  IsPrivate: false,
  ItemCount: 2032,
  LastItemDeletedDate: '2020-11-26T08:48:38Z',
  LastItemModifiedDate: '2020-11-26T10:50:47Z',
  LastItemUserModifiedDate: '2020-11-26T08:51:26Z',
[snip}

the Id field definitely starts with a "dec" ..

Eirik Brandtzæg
@eirikb
The code you used to get by ID, what does it look like?
jmls
@jmls
return sp.web.lists.getById(id).get();
where id is "dec72266-3364-4337-94eb-c6237d8dddca"
if I remove the "dec" the list is not found (obviously)
but if I use the "dec" it falls over as it's not a valid guid
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 :)