Skip to content

Bug: 'spo file add' removing leading zeros #702

@ohthreesixtyfive

Description

@ohthreesixtyfive

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"

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions