Skip to content

Bug report: spo listitem add does not work #5750

@jorgecc

Description

@jorgecc

Priority

(Urgent) I can't use the CLI

Description

Hi there:
I am trying to use spo listitem add and it does not work correctly because it considers the argument of the command as name of column in the list of sharepoint.

Steps to reproduce

m365 spo listitem add --contentType Item --listTitle "Demo List" --webUrl https://contoso.sharepoint.com/sites/project-x --Title "Demo Item"
(changing the list for the list of my tenant, and the URL using the URL of the site)

Expected results

(insert an element to the list)

Actual results

"Error: La columna 'c' no existe. Puede que otro usuario la haya eliminado. /sites/ats/Lists/Camaras"
Translated:
"Error: Column 'c' does not exist. Another user may have deleted it. /sites/ats/Lists/Camaras"

Diagnostics

Its using the argument --contentType (alias of -c) as name of a column in the list of SharePoint.
Removing this argument, it generates an error with the argument --listTitle which is also consider it as a name of column

CLI for Microsoft 365 version

7.3.0

nodejs version

v21.5.0

Operating system (environment)

Windows

Shell

PowerShell

cli doctor

{
  "os": {
    "platform": "win32",
    "version": "Windows 10 Pro",
    "release": "10.0.19044"
  },
  "cliVersion": "7.3.0",
  "nodeVersion": "v21.5.0",
  "cliAadAppId": "31359c7f-bd7e-475c-86db-****",
  "cliAadAppTenant": "organizations",
  "authMode": "Password",
  "cliEnvironment": "",
  "cliConfig": {},
  "roles": [],
  "scopes": {
    "https://graph.microsoft.com": [
      "AllSites.FullControl",
      "AppCatalog.ReadWrite.All",
      "ChannelMember.ReadWrite.All",
      "ChannelMessage.Read.All",
      "ChannelMessage.Send",
      "ChannelSettings.ReadWrite.All",
      "Directory.AccessAsUser.All",
      "Directory.ReadWrite.All",
      "Group.ReadWrite.All",
      "IdentityProvider.ReadWrite.All",
      "Mail.ReadWrite",
      "Mail.Send",
      "Policy.Read.All",
      "Reports.Read.All",
      "Tasks.ReadWrite",
      "Team.Create",
      "TeamMember.ReadWrite.All",
      "TeamsApp.ReadWrite.All",
      "TeamsAppInstallation.ReadWriteForUser",
      "TeamSettings.ReadWrite.All",
      "TeamsTab.ReadWrite.All",
      "TermStore.ReadWrite.All",
      "User.Invite.All",
      "User.ReadWrite.All",
      "profile",
      "openid",
      "email"
    ],
    "https://****.sharepoint.com": [
      "AllSites.FullControl",
      "AppCatalog.ReadWrite.All",
      "ChannelMember.ReadWrite.All",
      "ChannelMessage.Read.All",
      "ChannelMessage.Send",
      "ChannelSettings.ReadWrite.All",
      "Directory.AccessAsUser.All",
      "Directory.ReadWrite.All",
      "Group.ReadWrite.All",
      "IdentityProvider.ReadWrite.All",
      "Mail.ReadWrite",
      "Mail.Send",
      "Policy.Read.All",
      "Reports.Read.All",
      "Tasks.ReadWrite",
      "Team.Create",
      "TeamMember.ReadWrite.All",
      "TeamsApp.ReadWrite.All",
      "TeamsAppInstallation.ReadWriteForUser",
      "TeamSettings.ReadWrite.All",
      "TeamsTab.ReadWrite.All",
      "TermStore.ReadWrite.All",
      "User.Invite.All",
      "User.ReadWrite.All"
    ]
  }
}

Additional Info

No response

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions