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
Andrew Koltyakov
@koltyakov
image.png
  const items = await list.items
    // .select('Id,Title,RoleAssignments/Member/Title,RoleAssignments/RoleDefinitionBindings/*')
    .expand('RoleAssignments/Member,RoleAssignments/RoleDefinitionBindings').get();
jmls
@jmls
thanks
if I have a field called "Current status works" then in returned data I get the property Current_x0020_status_x0020_works (yes, so x0020 is encoding for a space). Is there any way of getting the property back as either "Current_status_works" or "CurrentStatusWorks" ?
Andrew Koltyakov
@koltyakov
These are EntityPropertyName. In most of the cases, EntityPropertyName would be equal to InternalName.
An Internal name is created during a field provisioning and can't be changed later on. A good practice is defining Internal Name to contain no banned symbols. So an Internal Name would end up developer-friendly. The bad practice is creating fields manually and providing display name (Title) without thinking what an internal name it leads to.
The names can be checked via API:
image.png

Is there any way of getting the property back as either "Current_status_works" or "CurrentStatusWorks" ?

Only if a field is originally created/provisioned with a Dev-friendly internal name.
In the UI, it can be done by creating a field without using disallowed symbols when then a field is created renaming its display name to whatever a user should see in the UI.
Or creating a field with code. PnP Provisioning Engine does this job well.

jmls
@jmls
can I manually adjust the EntityPropertyName ?
Andrew Koltyakov
@koltyakov
No, please see the previous message.
jmls
@jmls
sorry, you only mentioned that internalName can't be changed. I was hoping that EntityPropertyName could ... ;)
thanks again
Andrew Koltyakov
@koltyakov
Oh, got it. Yes, the entity prop will be as internal with a little extension. In this term, yes, you can control what it ends up.
@jmls generally, if not using spaces, non latin characters, numbers in front of the name, underscores (etc.), prop name as well as internal name will be good for a developer eye.
jmls
@jmls
did this change between sp2010 and sp2019 ? I ask because I am modernizing an old js app that read data and sent it into a legacy app , but the field names they used are camelCase (both input and output) - unfortunately they upgraded their sp from 2010 to 2019 without doing any checks / tests and wondered why things "stopped working" :)
the urls they used include _vti_bin/ListData.svc and similar
Andrew Koltyakov
@koltyakov
_vti_bin/ListData.svc is the predecessor of Lists REST API, shares something similar, but legacy and not used
even in sp2010 times I know nobody who used it, those times JSOM was pretty much a thing
however, even in SPO the legacy APIs are still presented for backward compatibility reasons
"stopped working" - this could easily be the case, just imagine what a timeframe between those two versions releases ;)
Eirik Brandtzæg
@eirikb
I remember using the _vti_bin back in SharePoint 2007. Moved to JSOM in 2010. Still use a lot of JSOM
Andrew Koltyakov
@koltyakov
yep, JSOM/CSOM still have things to offer when something is not or ever-will-not-be/we'd-wish-it-to-be covered in REST, true story of sp dev
Eirik Brandtzæg
@eirikb
:D
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?