SOLVED

Column formatting coupled to display form

Copper Contributor

Hi there, I have what should be a simple problem to resolve.  I have a user that is applying custom formatting to a list column using JSON.  He is simply applying an width and height to a to a multi-line text field. This issue is that this formatting shows up on the list item display form when he just wants it to occur only for the list view.  It seems like the column formatting is coupled to both the list view and the display form. Is there a way to have the column formatting only apply to the list view?

 

For example, here is some column formatting JSON that sets the height of a colume to 500px.

 

{
"elmType": "div",
"txtContent": "@currentField",
"style": {
"height": "500px"
}
}

 

You can see that the formatting is reflected in the list view:

 

DaveWalker_1-1660603825000.png

 

... but it also formatted in the display form:

 

DaveWalker_2-1660603933108.png

 

We would like the custom formatting to only show in the list view.Preview

 

Thanks in advance,

Dave

1 Reply
best response confirmed by Dave Walker (Copper Contributor)
Solution

@Dave Walker 


According to my knowledge there is no way to do different column formatting based on List View and List Form.

 

You can create Field Customizer Using SPFX which will render only for list view.

 

Reference Link:

https://docs.microsoft.com/en-us/sharepoint/dev/spfx/extensions/get-started/building-simple-field-cu... 

 

Hope it will helpful to you and if so then please like this answer and mark this as best answer to help other people as well.

 

 

1 best response

Accepted Solutions
best response confirmed by Dave Walker (Copper Contributor)
Solution

@Dave Walker 


According to my knowledge there is no way to do different column formatting based on List View and List Form.

 

You can create Field Customizer Using SPFX which will render only for list view.

 

Reference Link:

https://docs.microsoft.com/en-us/sharepoint/dev/spfx/extensions/get-started/building-simple-field-cu... 

 

Hope it will helpful to you and if so then please like this answer and mark this as best answer to help other people as well.

 

 

View solution in original post