SharePoint Online: How to Breakdown Metadata by Groups in List Form?

Requirement: Divide Fields into Groups in SharePoint List Forms.

How to Breakdown Metadata into Groups in List Forms?

In the New List form, We wanted to group fields into groups so that It appears:

group form fields in sharepoint online

Add a script editor web part and place this script in it. In my case, I wanted to have the “Questions” grouping after the “Purpose of Travel” field in the list form.

<script src="https://code.jquery.com/jquery-3.5.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
    //set section text and field name
    AddSectionAfterField("Questions","Purpose of Travel");
});

function AddSectionAfterField(sectionText,fieldName){
    var $fieldTR=$(".ms-standardheader nobr:contains('"+fieldName+"')").closest("tr");
    $fieldTR.after("<tr style='background-color:white'><td colspan='2' class='ms-formbody' style='padding:0; color: #000;'><div style='font-size: 20px;margin-top: 10px;margin-bottom: 10px;'>"+sectionText+"</div><hr style='max-width: 550px;  margin: 0px; padding-bottom:15px'></td></tr>");
}

</script>

This approach works only on Classic experience.

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

Leave a Reply

Your email address will not be published. Required fields are marked *