SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.22k stars 988 forks source link

List Formatting: Callout is not displayed when `@currentField` is set to `src` in `embed` action #9671

Open tecchan1107 opened 3 weeks ago

tecchan1107 commented 3 weeks ago

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

Declarative list formatting

Developer environment

None

What browser(s) / client(s) have you tested

Additional environment details

No response

Describe the bug / error

If I set @currentField to the src of the embed action, the callout will not be displayed. If the internal name of the column is set, the callout will be displayed.

image

https://github.com/SharePoint/sp-dev-docs/assets/51254139/921a2d3d-aec3-485b-87fd-e82675247289

Steps to reproduce

  1. Create a YouTube column (column internal name: YouTube, column type: single line of text) in the list

  2. Set the URL for embedding in the created column

    image

    YouTube video used for verification: https://www.youtube.com/watch?v=MHopBnmhPzg URL for embedding: https://www.youtube.com/embed/MHopBnmhPzg?si=sYT8Tpmn6dv5Sc1e

  3. Set the following JSON to the formatting of the created YouTube column

Code using the internal name of the column ```json { "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "children": [ { "elmType": "div", "style": { "cursor": "pointer", "border-radius": "7px", "padding": "5px 10px", "display": "=if(@currentField,'flex','none')", "align-items": "center" }, "attributes": { "class": "ms-fontSize-s ms-fontColor-white ms-bgColor-themePrimary ms-bgColor-themeTertiary--hover" }, "customRowAction": { "action": "embed", "actionInput": { "src": "[$YouTube]", "width": "640", "height": "360" } }, "children": [ { "elmType": "span", "style": { "margin-right": "5px" }, "attributes": { "iconName": "MSNVideosSolid" } }, { "elmType": "span", "txtContent": "Watch YouTube" } ] } ] } ```

image

  1. Change YouTube column formatting created to the following JSON
JSON using @currentField ```json { "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "children": [ { "elmType": "div", "style": { "cursor": "pointer", "border-radius": "7px", "padding": "5px 10px", "display": "=if(@currentField,'flex','none')", "align-items": "center" }, "attributes": { "class": "ms-fontSize-s ms-fontColor-white ms-bgColor-themePrimary ms-bgColor-themeTertiary--hover" }, "customRowAction": { "action": "embed", "actionInput": { "src": "@currentField", "width": "640", "height": "360" } }, "children": [ { "elmType": "span", "style": { "margin-right": "5px" }, "attributes": { "iconName": "MSNVideosSolid" } }, { "elmType": "span", "txtContent": "Watch YouTube" } ] } ] } ```

image

Expected behavior

Callouts are displayed even if @currentField is used.

arkogupta commented 1 week ago

@tecchan1107 Thanks for reporting the bug. We'll take up the fix soon. Will update on the timelines.