pnpjs
pnpjs copied to clipboard
Question: Are there any examples using ReserveListItemId
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.
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?
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
Why not a calculated column? Or a second update (you're already making two calls) once you have the id?
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!
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.