question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: 'spo file add' removing leading zeros

See original GitHub issue

Description:

When adding a file and attempting to set a field (in this case a single-line of text), a value passed through with leading zeros will have those zeros removed.

Steps to reproduce:

spo file add --webUrl https://contoso.sharepoint.com/sites/project-x --folder 'Shared Documents' --path 'C:\MS365.jpg' --Title "000123"

Expected:

New file added to destination with a Title attribute of '000123'

Actual:

New file added to destination with a Title attribute of '123'

Additional notes (Updated: 12/6/2018):

After further testing, this only appears to affect values that contain only numerical characters. If any characters other than a number are included in the value (regardless of positioning), the leading zeros are preserved.

Therefore, the following will create a new item with the ‘Title’ attribute of ’ 000123’ as expected.

spo file add --webUrl https://contoso.sharepoint.com/sites/project-x --folder 'Shared Documents' --path 'C:\MS365.jpg' --Title " 000123"

Likewise, the following will create a new item with the ‘Title’ attribute of ‘000123 ABCD’ as expected.

spo file add --webUrl https://contoso.sharepoint.com/sites/project-x --folder 'Shared Documents' --path 'C:\MS365.jpg' --Title "000123 ABCD"

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
ohthreesixtyfivecommented, Dec 11, 2018

Thanks for bringing it up! I’ll have a look into it and hopefully we’ll be able to fix it quickly. Sorry for the trouble.

My pleasure! Major thanks to you and the other contributors for developing this as I’ve been able to use it on a major migration from an aging ECM to our SharePoint site.

Originally, I was using SharePointPnP PowerShell (Add-PnPFile), but was facing excessive memory usage issues when the amount of items being written was too large. Your very timely release of ‘spo add item’, which has not exhibited the same issue, has been greatly appreciated. 😃

For the time being, I simply appended a space (’ ') to the values that this was affecting - not too big of an issue (and something I can easily clean up later on).

I’m looking forward to building more solutions using this CLI.

Best regards,

Ramiro

1reaction
waldekmastykarzcommented, Dec 11, 2018

Thank you for the kind words and great to hear we could help you. Please, never hesitate to reach out if you find anything out of the ordinary or if we can help with anything 😊

Read more comments on GitHub >

github_iconTop Results From Across the Web

cvs export of sharepoint list removes leading zero's
The problem is that when the list is exported, the leading zeros get automatically removed from one of the numeric columns. Does anyone...
Read more >
Leading Zeros removed when setting single line of text ...
I have a responsive form in SharePoint 2019. There is a calculated value for Cost Center that contains a leading zero (Name: CostCenterCalc ......
Read more >
Leading zeros/prefix zeros removed from csv file when open it in
Hi, We are getting a CSV file from the server that need to open in excel to verify the data. But it removes...
Read more >
How to trim tail zero under Power Automate flow | by LAI TOCA
How to trim tail zero under Power Automate flow · Create the manual trigger flow. · Input the key of timestamp string format...
Read more >
Help with leading zero's - Altova User Support Forum
I need my xml to output leading zeros. I created a doc the shows what i am attempting to do. Please see doc...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found