pnp / List-Formatting

List Formatting Samples for use in SharePoint and Microsoft Lists
https://pnp.github.io/List-Formatting/
MIT License
1.74k stars 833 forks source link

Flashcard not working at my end #581

Closed AvniBhatt closed 1 year ago

AvniBhatt commented 2 years ago

Hello Team,

Flashcard demo does not work for me. Not sure if I misconfigured it, but, I used the same format as Specified here, i.e. Title, Description, Users. But when I apply it, It does not change the view. Other samples like announcements, contact-cards etc are perfectly working fine. i modified the JSON per attached to remove the color coding as per conditions and keep fix background color for all. Attached the modified JSON.

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/tile-formatting.schema.json", "height": 305, "width": 340, "hideSelection": true, "fillHorizontally": false, "formatter": { "elmType": "div", "attributes": { "class": "sp-row-card sp-card-borderHighlight" }, "style": { "width": "340px", "height": "305px", "border-color": "#6264a7", "border-style": "solid", "border-width": "1.5px", "box-shadow": "1px 1px 2px darkgrey", "border-radius": "6px", "background-color": "#6264a7", "white-space": "normal", "padding": "4px 4px 4px 4px", "font-size": "13px", "flex-direction": "column", "justify-content": "center", "cursor": "pointer" }, "customRowAction": { "action": "setValue", "actionInput": { "Users": "=if(indexOf([$Users.email] , @me) > -1 , removeFrom([$Users.email] , @me) , appendTo([$Users.email] , @me))" } }, "children": [ { "elmType": "div", "attributes": { "class": "ms-bgColor-white sp-css-borderColor-neutralLight sp-card-subContainer" }, "children": [ { "elmType": "div", "style": { "justify-content": "center", "flex-direction": "row" }, "attributes": { "class": "sp-card-displayColumnContainer" }, "children": [ { "elmType": "div", "style": { "background-color": "#6264a7", "white-space": "normal", "padding": "4px 4px 4px 4px", "font-size": "=if(indexOf([$Users.email] , @me) > -1, '17px', '30px')", "font-weight": "600", "color": "white", "justify-content": "center", "flex-direction": "column", "align-items": "center" }, "attributes": { "title": "[$Title]", "class": "ms-fontColor-neutralPrimary sp-card-content sp-card-highlightedContent" }, "txtContent": "=if(indexOf([$Users.email] , @me) > -1, '[$Description]', '[$Title]')" } ] } ] } ] } }

Regards, AB

tecchan1107 commented 2 years ago

Hi @AvniBhatt ! I just tried the attached code and it worked. Is it possible that you have the layout set to a list instead of a gallery? image

tecchan1107 commented 1 year ago

I close this issue once as I have not received any replies.