JSON formatting
5 TopicsSharePoint library choice column formatting
I am trying to format a JSON for a Choice column that has been set to "choice pills". I am trying to change things like font color, background color, border etc. So far trying to do this but doesn't seem to work: { "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "style": { "flex-wrap": "wrap", "display": "flex" }, "children": [ { "forEach": "__INTERNAL__ in @currentField", "elmType": "div", "style": { "color": "=if(@currentField == 'Sales', '#ff0000', if(@currentField == 'Marketing', '#006aff', if(@currentField == 'Warehouse', '#b882d7','green')))", "background-color": "=if(@currentField == 'Sales', '#FAA0A0', if(@currentField == 'Marketing', '#c1d3f7', if(@currentField == 'Warehouse', '#e4c1f7','#DAF7A6')))", "box-sizing": "border-box", "padding": "4px 8px 5px 8px", "overflow": "hidden", "text-overflow": "ellipsis", "display": "flex", "border-radius": "16px", "height": "24px", "align-items": "center", "white-space": "nowrap", "margin": "4px 4px 4px 4px" }, "attributes": { "class": { "operator": ":", "operands": [ { "operator": "==", "operands": [ "[$__INTERNAL__]", "Sales" ] }, "sp-css-backgroundColor-BgCornflowerBlue sp-css-color-CornflowerBlueFont", { "operator": ":", "operands": [ { "operator": "==", "operands": [ "[$__INTERNAL__]", "Marketing" ] }, "sp-css-backgroundColor-BgMintGreen sp-css-color-MintGreenFont", { "operator": ":", "operands": [ { "operator": "==", "operands": [ "[$__INTERNAL__]", "Warehouse" ] }, "sp-css-backgroundColor-BgGold sp-css-color-GoldFont", "sp-field-borderAllRegular sp-field-borderAllSolid sp-css-borderColor-neutralSecondary" ] } ] } ] } }, "txtContent": "[$__INTERNAL__]" } ] }Solved3KViews0likes3CommentsClickable Button on Gallery View Document Library
Hello, I have a document library where social media assets are stored. I would like to create a gallery view of the document library that displays a "Download" button, so when the user selects, the file is automatically downloaded to their device. I have figured out how to add the Download button, which works perfectly in the List view. When you switch to gallery view, the button does not display, but I was able to get the button to show up by adding "columnFormatterReference": "[$Download]" to the Format view JSON. However, when the user clicks on the Download button from the gallery view, the file opens. I removed the following JSON code, so the file does not open in a new tab: "customRowAction": { "action": "defaultClick" Now I just need to figure out how to make the "Download" button clickable. Any help would be greatly appreciated. I'm brand-new to JSON and coding in general.Solved4.2KViews0likes9CommentsHyperlink/Picture Column suddenly breaks external images in Gallery/Card Designer
We use a Flow with an API connection to grab image links from an external vendor and populate that data to the Hyperlink or Picture column of a SharePoint list. We then add JSON formatting to display the image links in a Gallery view. The Hyperlink or Picture Column is set to display as Picture. The external images still display fine in the list item view, just not the Gallery/Card view. This was working fine for several months, but something seems to have changed over the last weekend, causing externally linked images in Picture/Hyperlink Columns to break. I setup a simple test list to display this behavior using a public domain image. External Image link: https://www.publicdomainpictures.net/pictures/20000/velka/computer-memory-chips.jpg Internal Image link: https://[mydomain].sharepoint.com/sites/WebDev/SiteAssets/Lists/[LIST-ID/computer-memory-chips.jpg Here is an All Items List View sample: Here is a Gallery/Card Designer View sample of the same list: No JSON used in these examples, just the default Gallery / Card Designer: I've experimented with the Image column, which doesn't seem to exhibit this issue, but unfortunately that column is not available in the Create Items step of the Flow so I assume it cannot be dynamically populated.Solved2.1KViews1like2CommentsFormatted List View Limited To 30 Items
I have formatted a list with JSON and it looks good but I have found a peculiar error, no matter what I set the view item limit to, it only shows the first 30 items. I have a second, none formatted view that shows all of the items as expected so I know the items are in the list and I no that setting the item limit is working on un-formatted lists. Has anyone else noticed this?Solved5.1KViews0likes5CommentsGetting [object Object] in quick edit of list
Hi, I'm Having a picture column(getting the image from document library with url) and lookup column(i.e document type) i'm using json formatting when i view it in normal it is showing the link and when i do quick edit it is showing as object object so is there any custom json format where i can the name of image instead of object object kind and i have used following things but of no use: "txtContent": [$FieldName.columnName] "txtContent": "[$FieldName.displayValue]" "txtContent": [$FileLeafRef]4.5KViews0likes3Comments