> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# Replace Playlist Items

- Component: `appmixer.spotify.core.ReplacePlaylistItems`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.spotify 1.0.0](https://connectors.appmixer.com/connector/appmixer.spotify/1.0.0.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.spotify/1.0.0/component/appmixer.spotify.core.ReplacePlaylistItems>

Replaces the entire contents of a Spotify playlist with the given tracks - the way to keep a rolling "latest show" playlist. Leave the URIs empty to clear the playlist.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Playlist (`playlistId`) | text | Start typing to pick one of your playlists, or enter a playlist ID, `spotify:playlist:` URI or open.spotify.com link directly. |
| Track URIs (`uris`) | textarea | The tracks the playlist should contain afterwards. Accepts an array of URIs (or of Find Tracks records), or a comma / newline separated list. Leave empty to remove every item. |

## Output ports

### Port `out`

_No fields defined for this port._

## Full metadata (component.json)

```json
{
  "name": "appmixer.spotify.core.ReplacePlaylistItems",
  "label": "Replace Playlist Items",
  "description": "Replaces the entire contents of a Spotify playlist with the given tracks - the way to keep a rolling \"latest show\" playlist. Leave the URIs empty to clear the playlist.",
  "author": "Appmixer <info@appmixer.com>",
  "version": "1.0.0",
  "auth": {
    "service": "appmixer:spotify"
  },
  "quota": {
    "manager": "appmixer:spotify",
    "resources": "requests",
    "scope": {
      "userId": "{{userId}}"
    }
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "playlistId": {
            "type": "string"
          },
          "uris": {
            "type": "string"
          }
        },
        "required": [
          "playlistId"
        ]
      },
      "inspector": {
        "inputs": {
          "playlistId": {
            "type": "text",
            "index": 1,
            "label": "Playlist",
            "tooltip": "Start typing to pick one of your playlists, or enter a playlist ID, <code>spotify:playlist:</code> URI or open.spotify.com link directly.",
            "source": {
              "url": "/component/appmixer/spotify/core/ListPlaylists?outPort=out",
              "data": {
                "transform": "./ListPlaylists#toSelectArray",
                "messages": {
                  "in/outputType": "array",
                  "in/isSource": true
                }
              }
            }
          },
          "uris": {
            "type": "textarea",
            "index": 2,
            "label": "Track URIs",
            "tooltip": "The tracks the playlist should contain afterwards. Accepts an array of URIs (or of Find Tracks records), or a comma / newline separated list. Leave empty to remove every item."
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "schema": {
        "type": "object",
        "properties": {}
      }
    }
  ],
  "icon": "(data URI omitted)"
}
```
