pnpjs icon indicating copy to clipboard operation
pnpjs copied to clipboard

Question: Are there any examples using ReserveListItemId

Open proce opened this issue 3 years ago • 3 comments

Category

  • [ ] Enhancement
  • [ ] Bug
  • [X] Question
  • [ ] Documentation gap/issue

Version

Please specify what version of the library you are using: [ 3.5.1 ]

Please specify what version(s) of SharePoint you are targeting: [ Online ]

Question

The Docs cover reserving a ListItemId here but I can't see any examples in this documentation or else where online covering how to use this reserved id when the ListItem is being created.

I have tried a few different ways but I either run into an error when I try to specify the id or end up the next id rather than the one I reserved.

proce avatar Aug 01 '22 14:08 proce

There really are not as it's not currently implemented in the library as we really don't have any use cases for it, it's just not something that is necessary as far as we know, but certainly you may know something we don't. Can you elaborate on what you're trying to accomplish?

juliemturner avatar Aug 01 '22 16:08 juliemturner

Thank you for getting back to me.

We were trying to do the following:

  • Get the next id
  • Create a user identifier e.g., Form-00001
  • Save that along with the other required info as part of the V1 in the ListItem’s version history

What we are currently doing:

  • Saving item to SharePoint (V1)
  • Get ListItem Id
  • Create a user identifier e.g., Form-00001
  • Update the item in SharePoint (V2)

We investigated using column formatting to generate the identifier however, some of our identifier formats have multiple placeholders which we want to avoid adding to the list. e.g. Form/USA/FL/22/00001

proce avatar Aug 02 '22 13:08 proce

Why not a calculated column? Or a second update (you're already making two calls) once you have the id?

patrick-rodgers avatar Aug 12 '22 18:08 patrick-rodgers

Closing this issue as answered. If you have additional questions or we did not answer your question, please open a new issue, ref this issue, and provide any additional details available. Thank you!

patrick-rodgers avatar Aug 30 '22 14:08 patrick-rodgers

This issue is locked for inactivity or age. If you have a related issue please open a new issue and reference this one. Closed issues are not tracked.

github-actions[bot] avatar Sep 02 '22 02:09 github-actions[bot]