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
And I do .setup outside of everything, as it doesn't matter when/how it is done
AshokSPFX-cloud
@AshokSPFX-cloud
copyto(destinationurl,true) , when i am trying this it throwing error "The label that's applied to this item prevents it from being moved or renamed. Check the item's label for more details"
Miguel Ángel González Muñoz
@dactivo
Hi, Andrew, I was trying to implement react solution with webpack for Sharepoint 2013, I have seen too the generator sppp, my project works great for react and ui-fabric, but not for spfx-controls-react (its name says everything :-(), do you know if there is a possibility of tweaking it or any version for spfx-controls-react that can be compatible for this version of SHP? If not, any advice about other bundle of controls apart react and ui fabric. Thx.
@koltyakov thx for your help
Eirik Brandtzæg
@eirikb
Does items..versions escape field names? So escaped field names are double escaped ?
E.g., I noticed Last Modified looks like Last_x005f_x0020_x005f_Modified
Space is escaped as x0020, and _ is escaped as x005f, so it becomes:
Last Modified -> Last_x0020_Modified (in item) -> Last_x005f_x0020_x005f_Modified (in versions).
I don't see how this can be properly "unescaped"
jmls
@jmls
morning all - I'm a sharepoint and pnp noob and struggling to get some data back how I'd like
if I make a request to get a list item, I get this data back
"RoleAssignments": {
    "__deferred": {
      "uri": "<sharepoint_url>/_api/Web/Lists(guid'9af2ab3e-3a61-49a5-bd25-492ea7191b43')/Items(31)/RoleAssignments"
    }
  },

  "FileSystemObjectType": 0,
  "Id": 31,
  "ServerRedirectedEmbedUrl": "",
  "Dependency": false,
what is the "__deferred" property here ? do I need to make another call to get the RoleAssignments property or can I tell sp / pnp to get it as part of the initial request ?
and do I have to do the same for each deferred property ?
Andrew Koltyakov
@koltyakov
Hey @jmls, it depends. In REST API, via this URL you can get corresponding object(s) for a specific object.
However, extra requests would be incorrect in case some additional data is needed for collection.
REST API allows expanding and selecting the props.
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).