Apr 18 2023 05:58 AM - edited Apr 18 2023 05:58 AM
Hi,
I am struggling with the simple formatting of the multiline text field (not a rich text field). I want to display the pencil which when you click, opens the item in the edit mode. When I apply the JSON format below values in my column disappear but the pencil is visible and actionable. Can you tell me what am I doing wrong?
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"children": [
{
"elmType": "div",
"txtContent": "@currentField",
"style": {
"white-space": "nowrap",
"overflow": "hidden",
"text-overflow": "ellipsis"
},
"attributes": {
"iconName": "Edit",
"class": "sp-field-quickActions"
},
"customRowAction": {
"action": "editProps"
}
}
]
}
Redirect me with my question if this is not the right forum.
Here it is before applying the format:
And here is after applying the format;
Apr 18 2023 06:48 AM - edited Apr 18 2023 07:01 AM
Solution@Michal_Z Can you please check and confirm if there is any data for starting items/rows shown in your screenshot?
I just tried using same JSON you provided and it is working fine for me:
Also, for last item/row in your screenshot I can see some HTML code. This HTML comes when you are using rich text (or if you are manually entering HTML in plain text) column. Can you check one more time if the column is plain text or rich text column?
Related read: 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.
For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs
Apr 18 2023 09:23 AM
Hi @ganeshsanap
You were right. This field was marked as rich text. I was sure that it is not but I was wrong.
Now, when I correct the filed type, all looks OK.
Do you know by the way how to limit the height of the row on thee format view?
I tried the following but without any impact on the height of the rows.
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
"elmType": "div",
"style": {
"min-height":"1em",
"height": "1em"
}
}
Apr 19 2023 01:23 AM
@Michal_Z Height or row depends on the largest height of content from all the columns in the list view.
If you want to reduce the height of row, try to limit the height of columns / truncate text in columns to fixed number of characters using column formatting. Height of row will be automatically adjusted accordingly.
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.
For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs
Jul 16 2023 01:28 PM
Apr 18 2023 06:48 AM - edited Apr 18 2023 07:01 AM
Solution@Michal_Z Can you please check and confirm if there is any data for starting items/rows shown in your screenshot?
I just tried using same JSON you provided and it is working fine for me:
Also, for last item/row in your screenshot I can see some HTML code. This HTML comes when you are using rich text (or if you are manually entering HTML in plain text) column. Can you check one more time if the column is plain text or rich text column?
Related read: 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.
For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs