Back to column formats
Column formattingSharePoint Online

Displaying embedded content using the embed action

This sample demonstrates displaying embedded content using the embed action.

Displaying embedded content using the embed action formatting preview
Sample preview · View original image

Copy. Apply. Make it yours.

Get this format

1 definition

Review the requirements below, then paste this JSON into the matching formatting panel. Show me where.

Use your list's internal column names and replace any tenant-specific URLs or flow IDs. Formatting is presentation, not a way to secure data.

From the contributor

How to use this sample

Summary

This sample demonstrates displaying embedded content using the embed action.

screenshot of the sample

[!NOTE]

  • This sample and the embed action are only available in the newer version of the Microsoft Lists App.

Prerequisites

Allowing Embedding in HTML Field Security Settings

To embed content, the target site must be allowed for embedding. For guidance on how to allow embedding, please refer to Allow or restrict the ability to embed content on SharePoint Lists using custom formatters.

If you try to embed a site that is not allowed to be embedded, the following error screen will appear:

screenshot of the error screen when target site is not allowed to embed

Obtaining and Setting the Embedding URL

The URL in the hyperlink column must be set to an embedding URL. This URL is usually found in the src attribute of the iframe element.

For example, the embedding URL for YouTube can be obtained as follows:

  1. Open the desired video on YouTube

  2. Select the Share button

  3. Select the Embed button

  4. Copy the URL from the src attribute in the embed code

    instructions on how to get the embedding URL for YouTube videos

If the URL is not an embedding URL, the following error screen may appear:

screenshot of the error screen if the URL is not an embedding URL

View requirements

This format can be applied to a Hyperlink column.

Sample

Solution Author(s)
hyperlink-embed.json Tetsuya Kawahara

Version history

Version Date Comments
1.0 August 27, 2024 Initial release

Disclaimer

THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.


Additional notes