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"
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:
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.
Likewise, the following will create a new item with the 'Title' attribute of '000123 ABCD' as expected.