SOLVED

Gallery View Formatting

Copper Contributor

Hello!

 

I am having an issue with bringing in custom formatting to my SharePoint gallery view.

bryanfrumkin47_0-1706043468927.png

As you can see, on my title column, I am applying font color/size/italicization; however, these changes are not coming over to the gallery view.

bryanfrumkin47_1-1706043537198.png

I know these changes are not coming over because I have implemented custom formatting onto my metrics column to make the font size 30px.
Is there any way to keep the advanced metric formatting and include the formatting for title that I mentioned from the first image?

 

When I add my custom formatting from the title column onto my gallery layout "format view" screen, it doesn't include the adjustment I've made to the metric column, it just overrides with the new colors.

bryanfrumkin47_2-1706043758177.png

 

 

Any help would be very appreciated as I've been trying continuously.

Here is the custom formatting from my metrics column: 

{
"elmType": "div",
"style": {
"box-sizing": "border-box",
"padding": "0 2px",
"overflow": "hidden",
"text-overflow": "ellipsis",
"font-size": "30px"
},
"attributes": {
"class": {
"operator": ":",
"operands": [
{
"operator": "!=",
"operands": [
"[$Metric]",
"0"
]
},
"sp-field-fontSizeXLarge sp-field-bold",
""
]
}
},
"txtContent": "[$Metric]"
}
2 Replies
best response confirmed by bryanfrumkin47 (Copper Contributor)
Solution

@bryanfrumkin47 You can reference the JSON column formatting in your view formatting using columnFormatterReference. For example: 

 

{
  "columnFormatterReference": "[$FieldName]"
}

 

Where [$FieldName] is an internal name of your Request column in SharePoint list in this format: [$InternalNameOfColumn]. You can get the internal name of your SharePoint list columns by following this article: How to find the Internal name of columns in SharePoint Online?


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

Thank you so much @ganeshsanap,

The columnformatterReference was already referencing my metric column, but not my title column.
Once I added in the title column reference, it worked as needed.
1 best response

Accepted Solutions
best response confirmed by bryanfrumkin47 (Copper Contributor)
Solution

@bryanfrumkin47 You can reference the JSON column formatting in your view formatting using columnFormatterReference. For example: 

 

{
  "columnFormatterReference": "[$FieldName]"
}

 

Where [$FieldName] is an internal name of your Request column in SharePoint list in this format: [$InternalNameOfColumn]. You can get the internal name of your SharePoint list columns by following this article: How to find the Internal name of columns in SharePoint Online?


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

View solution in original post