Playlist Item
Playlist Item connects your flow to your YouTube channel to manage the videos a playlist contains: see which videos it has, add a video at the position you want, move it to another position or remove it from the playlist.
Each video inside a playlist is an item with its own ID, different from the video’s ID. That item ID is the one used to move or remove it.
When to use it
- Add every new video of a course to its playlist as soon as it is published.
- Put the latest video in the first position of the “what’s new” playlist.
- Check which videos a playlist has to send the index to students.
- Remove videos that are no longer current from a playlist.
Configuration
You need a Youtube API credential, which connects by signing in with your Google account. When you create it you must enter the Client ID and Client Secret of your own Google Cloud project. See Credentials.
| Field | What it does |
|---|---|
| Credential (required) | The Youtube API credential used to access your channel. |
| Operation | What the component does. See Operations. Default: Get Playlist Items. |
| Item ID | The ID of the playlist item. You find it in the id field of the Get Playlist Items result. Required in Delete Playlist Item and Update Playlist Item. In Get Playlist Items, it returns only that item. It does not appear in Create Playlist Item. |
| Playlist ID | The playlist’s ID or link. Required in Create Playlist Item. In Get Playlist Items, it returns the videos of that playlist; fill in this field or Item ID. |
| Max Results | Only in Get Playlist Items. The maximum number of videos to return. Default: 10. |
| Video ID | Only in Create Playlist Item, where it is needed. The ID or link of the video you want to add. |
| Index | In Create Playlist Item and Update Playlist Item. The video’s position in the playlist, starting at 0 for the first one. Default: 0. |
Operations
| Operation | What it does |
|---|---|
Get Playlist Items | Returns the videos of a playlist, or one item from its Item ID. |
Create Playlist Item | Adds a video to the playlist at the position given in Index. |
Delete Playlist Item | Removes a video from the playlist. The video is not deleted from YouTube. |
Update Playlist Item | Moves a video to the position given in Index. |
Output
The Result output returns one item per playlist video you worked with: the item ID (id), the video’s title and description, its image, the video ID (video_id), the playlist ID (playlist_id), its position (position) and its privacy. Delete Playlist Item returns a confirmation.
You can connect the result to an email component to send the playlist index, or to an agent. The component can also be connected to an Agent as a tool. See Tool Mode.
Example
An academy adds every new lesson to its course playlist.
- When the lesson is uploaded, the flow receives the video link.
- Add Playlist Item with the
Create Playlist Itemoperation. - Paste the course playlist link in Playlist ID and the video link in Video ID.
- In Index, enter the lesson number minus one so it lands in place: lesson 1 at position 0, lesson 2 at 1, and so on.
Good practices
- To move or remove a video use the Item ID, not the video ID. If you don’t have it, get it first with
Get Playlist Items. - You can only change the playlists of your own channel.