How to use set-pnplistitem if columns have spaces?

Steve Wright 81 Reputation points

I am trying to use Set-PnPListItem to set a column (metadata) value but it doesn't work if the column name has a space in it. I have seen some very old posts that say to remove the spaces from the field name but keep them for the display name, but I've no idea how to do that.

Is there a proper way to handle columns with spaces in the names or must I really remove them?

BTW, I was using the "Set metadata of an existing file" example here as my reference.

A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
6,456 questions
{count} votes

1 answer

Sort by: Newest
  1. JoyZ 17,931 Reputation points

    PLease use the internal name of field.

    Go to list settings> click on the column and get its internal name in address bar as shown below:



    If the response is helpful, please click "Accept Answer" and upvote it.